/* ===== Quiz kiosk — οθόνη αφής ===== */
:root {
  --accent: #ff7a1a;
  --bg1: #0d1b3e;
  --bg2: #17397a;
  --ink: #1d1b33;
  --paper: #fffdf7;
  --muted: #6b6884;
  --ok: #1fbf6a;
  --bad: #ff4d5e;
  --a1: #ff5d73; --a2: #3a86ff; --a3: #ffb400; --a4: #18b98a; --a5: #9b5de5; --a6: #ff8fab;
  --r: clamp(18px, 2.4vmin, 32px);
  --gap: clamp(12px, 2vmin, 28px);
  --fs: clamp(18px, 2.6vmin, 34px);
  --display: 'Comfortaa', 'Manrope', system-ui, sans-serif;
  --body: 'Manrope', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; }
body {
  font-family: var(--body); font-size: var(--fs); color: var(--paper);
  background: radial-gradient(120% 90% at 20% 0%, var(--bg2), var(--bg1) 70%);
  user-select: none; -webkit-user-select: none; touch-action: manipulation; overscroll-behavior: none;
}
img { -webkit-user-drag: none; }

/* κινούμενα φόντο */
.sky span { position: fixed; border-radius: 50%; filter: blur(2px); opacity: .22; animation: float 18s ease-in-out infinite; z-index: 0; }
.sky span:nth-child(1) { width: 38vmin; height: 38vmin; background: #e8452c; left: -10vmin; top: 8vh; }
.sky span:nth-child(2) { width: 26vmin; height: 26vmin; background: #ffc21a; right: -6vmin; top: 30vh; animation-delay: -4s; }
.sky span:nth-child(3) { width: 44vmin; height: 44vmin; background: #2a63c9; left: 30vw; bottom: -22vmin; animation-delay: -9s; }
.sky span:nth-child(4) { width: 14vmin; height: 14vmin; background: #ff8a1f; left: 12vw; bottom: 18vh; animation-delay: -2s; }
.sky span:nth-child(5) { width: 18vmin; height: 18vmin; background: #d62d27; right: 14vw; top: 4vh; animation-delay: -12s; }
@keyframes float { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(3vmin,-4vmin) scale(1.08); } }

#app { position: relative; z-index: 1; height: 100%; display: flex; flex-direction: column; }
.screen { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: calc(var(--gap) * 2); gap: calc(var(--gap) * 1.4); animation: enter .45s cubic-bezier(.2,.9,.3,1.2) both; min-height: 0; }
@keyframes enter { from { opacity: 0; transform: translateY(4vmin) scale(.98); } to { opacity: 1; transform: none; } }

h1, h2, h3 { font-family: var(--display); margin: 0; text-align: center; line-height: 1.15; }
h1 { font-size: clamp(40px, 8vmin, 120px); text-shadow: 0 .6vmin 0 rgba(0,0,0,.2); }
h2 { font-size: clamp(28px, 5vmin, 72px); }
.sub { font-size: clamp(20px, 3.4vmin, 44px); opacity: .9; text-align: center; }

.btn { font: 800 var(--fs) var(--body); border: 0; border-radius: 999px; padding: .7em 1.6em; cursor: pointer;
  color: var(--ink); background: var(--paper); box-shadow: 0 .7vmin 0 rgba(0,0,0,.25); transition: transform .08s; }
.btn:active { transform: translateY(.5vmin) scale(.97); box-shadow: 0 .2vmin 0 rgba(0,0,0,.25); }
.btn.primary { background: var(--accent); color: #fff; }
.btn.ghost { background: rgba(255,255,255,.14); color: #fff; }
.btn.xl { font-size: clamp(24px, 4vmin, 56px); }
.row { display: flex; gap: var(--gap); flex-wrap: wrap; justify-content: center; }

.topbar { position: absolute; top: var(--gap); left: var(--gap); right: var(--gap); display: flex; justify-content: space-between; z-index: 2; }
.back { font-size: clamp(18px, 2.6vmin, 32px); padding: .5em 1.1em; }

/* Οθόνη αναμονής */
.attract { cursor: pointer; }
.attract .logo { max-height: 30vmin; max-width: 60vw; filter: drop-shadow(0 1vmin 2vmin rgba(0,0,0,.35)); }
.attract .hand { font-size: clamp(70px, 14vmin, 200px); animation: tap 1.4s ease-in-out infinite; }
@keyframes tap { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-3vmin) rotate(-6deg); } }
.attract .pulse { animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .55; } }
.podium { display: flex; gap: var(--gap); align-items: flex-end; margin-top: var(--gap); }
.podium div { background: rgba(255,255,255,.12); border-radius: var(--r); padding: .6em 1em; text-align: center; min-width: 22vmin; }
.podium b { display: block; font-size: 1.6em; }
.podium small { opacity: .8; }

/* Κάρτες επιλογής */
.choices { display: grid; gap: var(--gap); width: min(100%, 1500px); grid-template-columns: repeat(auto-fit, minmax(min(100%, 30vmin), 1fr)); }
.choice { border: 0; border-radius: var(--r); padding: calc(var(--gap) * 1.2); background: var(--paper); color: var(--ink);
  display: flex; flex-direction: column; align-items: center; gap: .3em; font: 800 clamp(22px, 3.4vmin, 48px) var(--display);
  cursor: pointer; box-shadow: 0 1vmin 0 rgba(0,0,0,.22); transition: transform .1s; position: relative; overflow: hidden; }
.choice::before { content: ''; position: absolute; inset: 0 0 auto 0; height: 1.1vmin; background: var(--c, var(--accent)); }
.choice:active { transform: translateY(.6vmin) scale(.97); box-shadow: 0 .3vmin 0 rgba(0,0,0,.22); }
.choice .ico { font-size: clamp(54px, 9vmin, 130px); line-height: 1; }
.choice small { font: 600 clamp(15px, 2vmin, 26px) var(--body); color: var(--muted); }
.choice[disabled] { opacity: .45; filter: grayscale(1); }
.choice.mixed { background: linear-gradient(135deg, #fff6d6, #ffe0ec); }
.langs .choice .ico { font-size: clamp(70px, 13vmin, 180px); }

/* Ερώτηση */
.quiz { justify-content: flex-start; padding-top: calc(var(--gap) * 1.2); }
.hud { width: min(100%, 1500px); display: flex; align-items: center; gap: var(--gap); font-weight: 800; }
.hud .pill { background: rgba(255,255,255,.15); border-radius: 999px; padding: .35em .9em; white-space: nowrap; }
.hud .grow { flex: 1; }
.dots { display: flex; gap: .6vmin; flex: 1; }
.dots i { flex: 1; height: 1.2vmin; min-height: 6px; border-radius: 9px; background: rgba(255,255,255,.2); }
.dots i.ok { background: var(--ok); } .dots i.bad { background: var(--bad); } .dots i.cur { background: #fff; }
.timer { width: min(100%, 1500px); height: clamp(10px, 1.6vmin, 22px); background: rgba(255,255,255,.15); border-radius: 99px; overflow: hidden; }
.timer i { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, var(--ok), var(--a3)); border-radius: 99px; transform-origin: left; }
.timer.low i { background: var(--bad); }
.qcard { width: min(100%, 1500px); background: var(--paper); color: var(--ink); border-radius: var(--r); padding: calc(var(--gap) * 1.4);
  box-shadow: 0 1.2vmin 0 rgba(0,0,0,.2); display: flex; flex-direction: column; align-items: center; gap: var(--gap); flex-shrink: 1; min-height: 0; }
.qcard .qtext { font: 700 clamp(26px, 4.6vmin, 70px) var(--display); text-align: center; line-height: 1.25; }
.qcard img { max-width: 100%; max-height: 32vh; border-radius: calc(var(--r) * .7); object-fit: contain; }
.answers { width: min(100%, 1500px); display: grid; gap: var(--gap); grid-template-columns: 1fr 1fr; }
/* Κάθετη οθόνη kiosk: γεμίζουμε το ύψος με μεγαλύτερη ερώτηση και κουμπιά σε μία στήλη */
@media (orientation: portrait) {
  .quiz .qcard { flex: 1 1 auto; justify-content: center; max-height: 42vh; }
  .quiz .answers { grid-template-columns: 1fr; }
  .quiz .answers.many { grid-template-columns: 1fr 1fr; }
  .quiz .ans { min-height: 10.5vh; }
  .quiz .qcard img { max-height: 24vh; }
}
.ans { border: 0; border-radius: var(--r); padding: .8em 1em; min-height: 13vmin; font: 800 clamp(22px, 3.6vmin, 54px) var(--body);
  color: #fff; background: var(--c); display: flex; align-items: center; gap: .6em; text-align: left; cursor: pointer;
  box-shadow: 0 1vmin 0 rgba(0,0,0,.25); transition: transform .1s, opacity .3s, filter .3s; }
.ans:active { transform: translateY(.6vmin) scale(.98); }
.ans .k { flex: none; width: 1.7em; height: 1.7em; border-radius: 50%; display: grid; place-items: center; background: rgba(255,255,255,.28); font-family: var(--display); }
.ans.dim { opacity: .35; filter: grayscale(.7); }
.ans.right { background: var(--ok); outline: .8vmin solid #fff; animation: pop .5s; }
.ans.wrong { background: var(--bad); animation: shake .45s; }
@keyframes pop { 40% { transform: scale(1.05); } }
@keyframes shake { 20%,60% { transform: translateX(-1.4vmin); } 40%,80% { transform: translateX(1.4vmin); } }

.feedback { position: fixed; left: 0; right: 0; bottom: 0; z-index: 5; padding: calc(var(--gap) * 1.5); color: #fff;
  display: flex; align-items: center; gap: calc(var(--gap) * 1.4); justify-content: center; flex-wrap: wrap;
  border-radius: var(--r) var(--r) 0 0; animation: up .35s cubic-bezier(.2,.9,.3,1.2); box-shadow: 0 -1vmin 3vmin rgba(0,0,0,.25); }
.feedback.ok { background: var(--ok); } .feedback.bad { background: var(--bad); }
.feedback .fb-emoji { font-size: clamp(56px, 10vmin, 140px); }
.feedback .fb-text { flex: 1 1 40vmin; max-width: 1100px; }
.feedback h3 { text-align: left; font-size: clamp(28px, 5vmin, 70px); }
.feedback p { margin: .3em 0 0; font-weight: 600; }
@keyframes up { from { transform: translateY(100%); } }

/* Αποτέλεσμα */
.stars { font-size: clamp(70px, 14vmin, 200px); letter-spacing: .1em; }
.stars span { display: inline-block; animation: star .6s both; filter: drop-shadow(0 .6vmin 0 rgba(0,0,0,.25)); }
.stars span:nth-child(2) { animation-delay: .25s; } .stars span:nth-child(3) { animation-delay: .5s; }
.stars .off { filter: grayscale(1) opacity(.35); }
@keyframes star { from { transform: scale(0) rotate(-90deg); } 70% { transform: scale(1.25); } }
.scorebox { background: rgba(255,255,255,.13); border-radius: var(--r); padding: calc(var(--gap)) calc(var(--gap) * 2); text-align: center; }
.scorebox .big { font: 700 clamp(56px, 11vmin, 160px) var(--display); color: var(--a3); line-height: 1; }

/* Πληκτρολόγιο */
.namebox { min-width: min(90vw, 900px); min-height: 1.6em; background: var(--paper); color: var(--ink); border-radius: var(--r);
  font: 800 clamp(34px, 6vmin, 90px) var(--display); text-align: center; padding: .2em .6em; }
.namebox .caret { display: inline-block; width: .08em; height: 1em; background: var(--accent); vertical-align: -.12em; animation: pulse 1s infinite; }
.kb { display: flex; flex-direction: column; gap: 1vmin; width: min(100%, 1400px); }
.kb .krow { display: flex; gap: 1vmin; justify-content: center; }
.kb button { flex: 1; max-width: 10vmin; min-width: 0; height: clamp(54px, 9vmin, 120px); border: 0; border-radius: 1.6vmin;
  background: var(--paper); color: var(--ink); font: 800 clamp(22px, 3.6vmin, 50px) var(--body); box-shadow: 0 .6vmin 0 rgba(0,0,0,.25); cursor: pointer; }
.kb button:active { transform: translateY(.4vmin); box-shadow: 0 .2vmin 0 rgba(0,0,0,.25); }
.kb button.wide { max-width: 50vmin; flex: 5; } .kb button.mid { max-width: 18vmin; flex: 2; }
.kb button.ok { background: var(--ok); color: #fff; } .kb button.fn { background: #d9d6ef; }

/* Βαθμολογίες */
.board { width: min(100%, 1100px); display: flex; flex-direction: column; gap: 1.2vmin; overflow: auto; }
.board .r { display: flex; align-items: center; gap: var(--gap); background: rgba(255,255,255,.12); border-radius: var(--r); padding: .45em 1em; font-weight: 800; }
.board .r.me { background: var(--accent); animation: pop .6s 2; }
.board .pos { width: 2.2em; text-align: center; font-family: var(--display); }
.board .nm { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board .sc { font-family: var(--display); color: var(--a3); }
.board .me .sc { color: #fff; }
.empty { opacity: .8; text-align: center; }

/* Modal αδράνειας */
.modal { position: fixed; inset: 0; z-index: 20; background: rgba(10,10,40,.7); display: grid; place-items: center; backdrop-filter: blur(6px); }
.modal.hidden { display: none; }
.modal-card { background: var(--paper); color: var(--ink); border-radius: var(--r); padding: calc(var(--gap) * 2); text-align: center; display: grid; gap: var(--gap); justify-items: center; }
.big-emoji { font-size: clamp(60px, 12vmin, 160px); }
.countdown { font: 700 clamp(60px, 12vmin, 160px) var(--display); color: var(--accent); }

#confetti { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 30; }
.loading { font-size: clamp(40px, 8vmin, 100px); animation: pulse 1s infinite; }
