/* Σκακομπελάδες — GorbaTech theme (gorbatech.com). Για άλλο brand άλλαξε τις μεταβλητές του :root (βλ. CUSTOMIZATION.md). */
@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+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2190-21FF, U+2212; }

:root {
  --bg: #06090E;
  --sky: #38BDF8;
  --blue: #2563EB;
  --indigo: #6366F1;
  --purple: #A855F7;
  --pink: #EC4899;
  --gold: #FACC15;
  --green: #22C55E;
  --danger: #EF4444;
  --glass: rgba(15, 23, 42, .75);
  --line: rgba(255, 255, 255, .1);
  --text: #F8FAFC;
  --muted: #94A3B8;
  --light-sq: #DBEAFE;
  --dark-sq: #6D7DE0;
  --font: "Ubuntu Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  background-image:
    radial-gradient(60% 40% at 15% 0%, rgba(56, 189, 248, .18), transparent 70%),
    radial-gradient(60% 40% at 90% 100%, rgba(99, 102, 241, .22), transparent 70%),
    linear-gradient(rgba(255, 255, 255, .035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .035) 1px, transparent 1px);
  background-size: auto, auto, 60px 60px, 60px 60px;
  background-attachment: fixed;
  color: var(--text); font-family: var(--font);
  -webkit-tap-highlight-color: transparent; user-select: none; -webkit-user-select: none; overscroll-behavior: none;
}
button { font: inherit; color: inherit; }
b { font-weight: 800; }
.glass { background: var(--glass); border: 1px solid var(--line); border-radius: 20px; -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }

/* top bar */
.bar { position: fixed; z-index: 30; top: 0; left: 0; right: 0; display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: calc(8px + env(safe-area-inset-top)) 14px 8px; background: linear-gradient(rgba(6, 9, 14, .92), rgba(6, 9, 14, .6) 70%, rgba(6, 9, 14, 0)); }
.brand { display: flex; align-items: center; gap: 9px; color: inherit; text-decoration: none; }
.brand img { border-radius: 50%; box-shadow: 0 0 0 2px rgba(56, 189, 248, .6); }
.brand-text { display: flex; flex-direction: column; line-height: 1.05; }
.brand-text b { font-size: 16px; }
.brand-text b span { color: var(--sky); }
.brand-text small { font-family: var(--mono); font-size: 8px; letter-spacing: .22em; color: var(--muted); }
.bar-tools { display: flex; gap: 8px; align-items: center; }
.tool { min-width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--line); background: var(--glass); cursor: pointer; }
.lang { display: flex; border: 1px solid var(--line); border-radius: 12px; background: var(--glass); padding: 3px; gap: 2px; }
.lang button { border: 0; background: none; color: var(--muted); font-weight: 700; font-size: 13px; padding: 7px 9px; border-radius: 9px; cursor: pointer; }
.lang button.on { background: var(--blue); color: #fff; }

/* screens */
.screen { display: none; min-height: 100%; padding: calc(62px + env(safe-area-inset-top)) 16px calc(20px + env(safe-area-inset-bottom)); }
.screen.active { display: block; }
.screen.overlay { position: fixed; inset: 0; z-index: 40; background: rgba(6, 9, 14, .7); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); align-items: center; justify-content: center; }
.screen.overlay.active { display: flex; }
.col { max-width: 480px; margin: 0 auto; display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; }
.col.wide { max-width: 560px; }
.mono-tag { font-family: var(--mono); letter-spacing: .3em; font-size: 11px; color: var(--sky); margin-top: 6px; }
.title { margin: 0; font-size: clamp(34px, 11.5vw, 68px); font-weight: 800; line-height: 1.05; letter-spacing: -.02em;
  background: linear-gradient(90deg, #38BDF8, #A855F7, #EC4899); -webkit-background-clip: text; background-clip: text; color: transparent; }
.subtitle { margin: 0; color: #CBD5E1; font-size: 18px; }
.h2 { margin: 6px 0 0; font-size: 26px; font-weight: 800; }
.note { margin: 0; font-size: 13px; color: var(--muted); line-height: 1.4; }

.btn { border: 1px solid var(--line); background: var(--glass); padding: 12px 18px; border-radius: 14px; font-weight: 700; font-size: 16px; cursor: pointer; transition: transform .1s; }
.btn.primary { border: 0; color: #fff; background: linear-gradient(135deg, #38BDF8, #2563EB); box-shadow: 0 10px 30px rgba(37, 99, 235, .35); }
.btn.big { font-size: 20px; padding: 16px 26px; width: 100%; }
.btn.small { font-size: 14px; padding: 8px 12px; }
.btn.ghost { background: transparent; }
.btn:active { transform: scale(.96); }
.btn[disabled] { opacity: .45; cursor: default; }
.row { display: flex; gap: 10px; width: 100%; }
.row .btn { flex: 1; }

/* hero */
.hero { position: relative; width: 280px; height: 170px; }
.hero-bit { position: absolute; left: 50%; top: 4px; margin-left: -75px; }
.hero-pieces img { position: absolute; width: 54px; animation: float 3s ease-in-out infinite; }
.hero-pieces img:nth-child(1) { left: 0; top: 30px; }
.hero-pieces img:nth-child(2) { right: 0; top: 18px; animation-delay: -.8s; }
.hero-pieces img:nth-child(3) { left: 18px; top: 110px; animation-delay: -1.6s; }
.hero-pieces img:nth-child(4) { right: 22px; top: 108px; animation-delay: -2.2s; }
@keyframes float { 50% { transform: translateY(-10px) rotate(-6deg); } }
.bob { animation: bob 2.6s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-6px); } }

/* speech bubble */
.bubble { position: relative; margin: 0; background: #fff; color: #0F172A; border-radius: 18px; padding: 12px 14px; font-size: 16px; line-height: 1.4; text-align: left; box-shadow: 0 8px 24px rgba(0, 0, 0, .3); }
.bubble.big { font-size: 17px; }
.bubble b { color: #1D4ED8; }
.bubble .sq { display: inline-block; background: #E0E7FF; color: #3730A3; border-radius: 6px; padding: 0 5px; font-weight: 800; }
.bubble .praise { color: #15803D; }
.bubble .oops { color: #B91C1C; }
.bubble .after { display: block; margin-top: 6px; }

/* map */
.trail { list-style: none; margin: 8px 0 0; padding: 0; width: 100%; position: relative; display: flex; flex-direction: column; gap: 6px; }
.trail::before { content: ""; position: absolute; left: 50%; top: 20px; bottom: 20px; border-left: 4px dashed rgba(56, 189, 248, .35); }
.stop { position: relative; width: 78%; display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 18px; border: 1px solid var(--line); background: var(--glass); cursor: pointer; text-align: left; }
.trail li:nth-child(odd) .stop { margin-right: auto; }
.trail li:nth-child(even) .stop { margin-left: auto; flex-direction: row-reverse; text-align: right; }
.stop .ic { flex: none; width: 54px; height: 54px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #1E3A8A, #312E81); border: 3px solid rgba(255, 255, 255, .18); }
.stop .ic img, .stop .ic svg { width: 40px; height: 40px; }
.stop .num { font-family: var(--mono); font-size: 11px; color: var(--sky); letter-spacing: .15em; }
.stop .name { font-weight: 800; font-size: 16px; line-height: 1.2; }
.stop .st { font-size: 15px; letter-spacing: 2px; color: rgba(255, 255, 255, .25); }
.stop .st .on { color: var(--gold); }
.stop.next { border-color: var(--sky); box-shadow: 0 0 0 3px rgba(56, 189, 248, .25), 0 10px 30px rgba(37, 99, 235, .3); }
.stop.next .ic { animation: pulse 1.6s ease-in-out infinite; }
.stop.done .ic { background: linear-gradient(135deg, #0EA5E9, #6366F1); }
@keyframes pulse { 50% { box-shadow: 0 0 0 8px rgba(56, 189, 248, .25); } }
.map-foot { display: flex; flex-direction: column; align-items: center; gap: 8px; margin-top: 14px; }

/* lesson */
#lesson { padding-bottom: calc(12px + env(safe-area-inset-bottom)); }
.lesson-col { max-width: 560px; margin: 0 auto; display: flex; flex-direction: column; gap: 10px; }
.lesson-head { display: flex; align-items: center; gap: 10px; }
.lesson-title { flex: 1; font-weight: 800; font-size: 18px; text-align: center; }
.dots { display: flex; gap: 4px; }
.dots i { width: 8px; height: 8px; border-radius: 50%; background: rgba(255, 255, 255, .18); }
.dots i.on { background: var(--sky); }
.dots i.cur { background: var(--gold); transform: scale(1.3); }
.guide { display: flex; align-items: flex-start; gap: 8px; min-height: 70px; }
.guide-bit { flex: none; }
.guide .bubble { flex: 1; }
.guide .bubble::before { content: ""; position: absolute; left: -8px; top: 22px; border: 8px solid transparent; border-left: 0; border-right-color: #fff; }
.guide-bit.happy { animation: hop .5s ease; }
.guide-bit.sad { animation: shake .45s ease; }
@keyframes hop { 40% { transform: translateY(-14px) rotate(-8deg); } }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }

.stage { display: flex; justify-content: center; }
.board-wrap { width: min(100%, calc(100svh - 360px), 520px); min-width: 260px; }
.board { display: grid; grid-template-columns: repeat(8, 1fr); grid-template-rows: repeat(8, 1fr); aspect-ratio: 1; border-radius: 14px; overflow: hidden; border: 4px solid rgba(255, 255, 255, .16); box-shadow: 0 16px 50px rgba(37, 99, 235, .3); touch-action: manipulation; }
.sq { position: relative; border: 0; padding: 0; margin: 0; min-width: 0; min-height: 0; aspect-ratio: 1; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.sq.l { background: var(--light-sq); }
.sq.d { background: var(--dark-sq); }
.sq img { position: absolute; left: 6%; top: 6%; width: 88%; height: 88%; pointer-events: none; z-index: 2; }
.sq img.star { left: 18%; top: 18%; width: 64%; height: 64%; animation: twinkle 1.6s ease-in-out infinite; }
@keyframes twinkle { 50% { transform: scale(1.12) rotate(8deg); } }
.sq .cf, .sq .cr { position: absolute; font-size: clamp(8px, 2.2vw, 11px); font-weight: 800; pointer-events: none; z-index: 3; opacity: .8; }
.sq .cf { right: 3px; bottom: 1px; }
.sq .cr { left: 3px; top: 1px; }
.sq.l .cf, .sq.l .cr { color: var(--dark-sq); }
.sq.d .cf, .sq.d .cr { color: var(--light-sq); }
.sq::after { content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 1; }
.sq.m-hl::after { background: rgba(56, 189, 248, .55); }
.sq.m-gold::after { background: rgba(250, 204, 21, .75); box-shadow: inset 0 0 0 3px #CA8A04; }
.sq.m-pink::after { background: rgba(236, 72, 153, .5); }
.sq.m-ok::after { background: rgba(34, 197, 94, .7); }
.sq.m-bad::after { background: rgba(239, 68, 68, .7); animation: blink .5s; }
.sq.m-x::before { content: "×"; position: absolute; z-index: 4; font-size: clamp(22px, 7vw, 40px); font-weight: 800; color: var(--danger); line-height: 1; }
.sq.sel::after { background: rgba(250, 204, 21, .55); }
.sq.dot::before { content: ""; position: absolute; z-index: 4; width: 28%; height: 28%; border-radius: 50%; background: rgba(15, 23, 42, .45); }
.sq.cap::before { content: ""; position: absolute; z-index: 4; inset: 4%; border-radius: 50%; border: 4px solid rgba(236, 72, 153, .9); }
.sq.hint-find { animation: none; }
@keyframes blink { 50% { opacity: .2; } }

.visual { width: 100%; display: none; flex-direction: column; align-items: center; gap: 8px; }
.stage.show-visual .board-wrap { display: none; }
.stage.show-visual .visual { display: flex; }
.showcase { width: 150px; height: 150px; border-radius: 28px; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #DBEAFE, #A5B4FC); box-shadow: 0 16px 50px rgba(99, 102, 241, .35); }
.showcase img { width: 80%; }
.values { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; width: min(100%, 420px); }
.values div { display: flex; flex-direction: column; align-items: center; padding: 8px 4px; }
.values img { width: 56px; height: 56px; }
.values b { font-size: 22px; color: var(--gold); }
.values small { color: var(--muted); font-size: 12px; }
.scale { position: relative; width: min(100%, 360px); height: 190px; }
.scale .post { position: absolute; left: 50%; bottom: 0; width: 16px; margin-left: -8px; height: 120px; background: linear-gradient(#A5B4FC, #6366F1); border-radius: 8px 8px 0 0; }
.scale .foot { position: absolute; left: 50%; bottom: 0; width: 120px; margin-left: -60px; height: 14px; border-radius: 8px; background: #6366F1; }
.scale .beam { position: absolute; left: 6%; right: 6%; top: 60px; height: 10px; border-radius: 6px; background: var(--sky); transition: transform .8s cubic-bezier(.3, 1.6, .5, 1); }
.scale .pan { position: absolute; top: -66px; width: 42%; height: 66px; display: flex; align-items: flex-end; justify-content: center; border-bottom: 6px solid #E2E8F0; border-radius: 0 0 40px 40px; transition: transform .8s; }
.scale .pan.l { left: -6%; } .scale .pan.r { right: -6%; }
.scale .pan img { width: 52px; height: 52px; margin: 0 -6px; }

.status { min-height: 20px; text-align: center; font-family: var(--mono); font-size: 13px; color: var(--muted); letter-spacing: .08em; }
.options { display: flex; flex-direction: column; gap: 8px; }
.options:empty, .tray:empty { display: none; }
.opt { width: 100%; padding: 14px; border-radius: 16px; border: 2px solid var(--line); background: var(--glass); font-size: 18px; font-weight: 700; cursor: pointer; }
.opt .sq { background: rgba(255, 255, 255, .12); border-radius: 6px; padding: 0 6px; }
.opt.ok { border-color: var(--green); background: rgba(34, 197, 94, .25); }
.opt.bad { border-color: var(--danger); background: rgba(239, 68, 68, .2); animation: shake .4s; }
.tray { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.tray button { width: 54px; height: 54px; border-radius: 14px; border: 2px solid var(--line); background: linear-gradient(135deg, #DBEAFE, #A5B4FC); padding: 4px; cursor: pointer; }
.tray button img { width: 100%; height: 100%; pointer-events: none; }
.tray button.on { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(250, 204, 21, .5); transform: translateY(-4px); }
.actions { display: flex; gap: 10px; justify-content: center; }
.actions .btn { min-width: 140px; }
.actions .btn[hidden] { display: none; }

/* done */
.done-card { padding: 22px 20px; width: min(92vw, 380px); }
.big-stars { font-size: 46px; letter-spacing: 6px; color: rgba(255, 255, 255, .2); }
.big-stars .on { color: var(--gold); text-shadow: 0 0 20px rgba(250, 204, 21, .6); display: inline-block; animation: pop .5s backwards; }
.big-stars .on:nth-child(2) { animation-delay: .2s; } .big-stars .on:nth-child(3) { animation-delay: .4s; }
@keyframes pop { 0% { transform: scale(0) rotate(-40deg); } 70% { transform: scale(1.3); } }

/* diploma */
#nameInput { width: 100%; padding: 14px; border-radius: 14px; border: 2px solid var(--sky); background: var(--glass); color: var(--text); font: inherit; font-size: 20px; text-align: center; user-select: text; -webkit-user-select: text; }
#dipCanvas { width: min(100%, 360px); height: auto; border-radius: 16px; box-shadow: 0 16px 50px rgba(37, 99, 235, .35); }

/* confetti */
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 60; overflow: hidden; }
.confetti i { position: absolute; top: -20px; width: 10px; height: 14px; border-radius: 2px; animation: fall 1.8s ease-in forwards; }
@keyframes fall { to { transform: translateY(110vh) rotate(720deg); } }

@media (min-width: 900px) {
  .board-wrap { width: min(100%, calc(100vh - 340px), 560px); }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
