/* ==============================================
   ΤΡΙΛΙΖΑ ΓΙΑ ΠΑΙΔΙΑ — Kids theme stylesheet
   Layered on top of /style.css base
   ============================================== */

/* ── Kids page body tweak ── */
body {
  background: var(--bg);
}

/* ── Header ── */
.kids-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid rgba(168, 85, 247, 0.2);
  background: rgba(6, 6, 26, 0.85);
  backdrop-filter: blur(16px);
  position: sticky;
  top: 0;
  z-index: 100;
}

.btn-back-kids {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--dim);
  text-decoration: none;
  padding: 7px 14px;
  border: 1px solid var(--border);
  border-radius: 100px;
  background: var(--glass);
  transition: all var(--t);
  white-space: nowrap;
}
.btn-back-kids:hover {
  color: var(--text);
  border-color: var(--border2);
  background: var(--glass-h);
}

/* ── Kids title ── */
.kids-title {
  font-family: 'Syne', sans-serif;
  font-size: clamp(1.4rem, 5vw, 2rem);
  font-weight: 800;
  letter-spacing: 0.08em;
  background: linear-gradient(135deg, #f472b6 0%, #a855f7 50%, #4cc9f0 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-align: center;
  flex: 1;
  margin: 0 12px;
}

/* ── Mini lang switcher ── */
.lang-mini {
  display: flex;
  gap: 4px;
  align-items: center;
}
.lang-mini-btn {
  background: none;
  border: 1px solid transparent;
  border-radius: 100px;
  cursor: pointer;
  font-size: 1.2rem;
  padding: 4px 6px;
  opacity: 0.45;
  transition: opacity var(--t), transform var(--t), border-color var(--t);
  line-height: 1;
}
.lang-mini-btn:hover { opacity: 0.8; transform: scale(1.15); }
.lang-mini-btn.active {
  opacity: 1;
  transform: scale(1.1);
  border-color: rgba(168, 85, 247, 0.4);
  background: rgba(168, 85, 247, 0.1);
}

/* ── Main wrapper ── */
.kids-main {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  padding: 24px 16px 60px;
  max-width: 480px;
  margin: 0 auto;
  width: 100%;
  position: relative;
  z-index: 1;
}

/* ── Symbol picker ── */
.symbol-picker {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
}

.picker-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--dim);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.symbol-pairs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.symbol-pair {
  background: var(--glass);
  border: 2px solid var(--border);
  border-radius: 20px;
  color: var(--text);
  cursor: pointer;
  font-size: 1.1rem;
  font-family: 'DM Sans', sans-serif;
  padding: 8px 16px;
  transition: all var(--t);
  line-height: 1.3;
  white-space: nowrap;
}
.symbol-pair:hover {
  border-color: rgba(168, 85, 247, 0.5);
  background: rgba(168, 85, 247, 0.08);
  transform: translateY(-2px);
}
.symbol-pair.active {
  border-color: #a855f7;
  background: rgba(168, 85, 247, 0.15);
  box-shadow: 0 0 12px rgba(168, 85, 247, 0.3);
}

/* ── Mode selector ── */
.mode-selector {
  display: flex;
  gap: 10px;
  width: 100%;
  justify-content: center;
}

.mode-btn {
  flex: 1;
  max-width: 200px;
  background: var(--glass);
  border: 2px solid var(--border);
  border-radius: 20px;
  color: var(--dim);
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.88rem;
  font-weight: 600;
  padding: 10px 14px;
  transition: all var(--t);
  white-space: nowrap;
}
.mode-btn:hover {
  border-color: rgba(168, 85, 247, 0.5);
  color: var(--text);
}
.mode-btn.active {
  background: rgba(124, 58, 237, 0.25);
  border-color: #7c3aed;
  color: var(--text);
  box-shadow: 0 0 14px rgba(124, 58, 237, 0.25);
}

/* ── Score bar ── */
.kids-score-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  width: 100%;
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 14px 24px;
}

.kids-score-item {
  display: flex;
  align-items: center;
  gap: 10px;
}

.kids-symbol {
  font-size: 2rem;
  line-height: 1;
}

.kids-score-val {
  font-family: 'Syne', sans-serif;
  font-size: 2rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1;
  min-width: 1.2ch;
  text-align: center;
}

.kids-draw-count {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--muted);
  background: var(--glass-h);
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 4px 12px;
  white-space: nowrap;
  text-align: center;
  min-width: 36px;
}
.kids-draw-count::before {
  content: '✱ ';
}

/* ── Status text ── */
.kids-status {
  font-family: 'DM Sans', sans-serif;
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--text);
  text-align: center;
  min-height: 2rem;
  padding: 6px 20px;
  background: rgba(168, 85, 247, 0.07);
  border: 1px solid rgba(168, 85, 247, 0.18);
  border-radius: 100px;
  transition: all 0.3s ease;
}

/* ── Board ── */
.kids-board {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  width: min(300px, calc(100vw - 48px));
  max-width: 320px;
}

.kids-cell {
  aspect-ratio: 1;
  background: var(--glass);
  border: 2px solid var(--border);
  border-radius: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  line-height: 1;
  transition: all var(--t);
  user-select: none;
  -webkit-user-select: none;
}
.kids-cell:not(.occupied):hover {
  background: rgba(168, 85, 247, 0.1);
  border-color: rgba(168, 85, 247, 0.5);
  transform: scale(1.05);
}
.kids-cell.occupied {
  cursor: default;
  animation: cellPop 0.25s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
@keyframes cellPop {
  from { transform: scale(0.6) rotate(-8deg); opacity: 0.5; }
  to   { transform: scale(1) rotate(0); opacity: 1; }
}

/* Winner cells — green pulse glow */
.kids-cell.winner-cell {
  border-color: #34d399;
  background: rgba(52, 211, 153, 0.12);
  animation: winCellPulse 0.9s ease-in-out infinite;
}
@keyframes winCellPulse {
  0%, 100% { box-shadow: 0 0 0 rgba(52, 211, 153, 0); }
  50%       { box-shadow: 0 0 18px rgba(52, 211, 153, 0.5); }
}

/* ── Actions ── */
.kids-actions {
  display: flex;
  justify-content: center;
  width: 100%;
}

.btn-kids-new {
  background: transparent;
  border: 2px solid var(--border);
  border-radius: 100px;
  color: var(--dim);
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  padding: 12px 28px;
  width: 100%;
  max-width: 280px;
  transition: all var(--t);
}
.btn-kids-new:hover {
  border-color: var(--border2);
  color: var(--text);
  background: var(--glass);
}

/* ── SEO section ── */
.kids-seo {
  width: 100%;
  margin-top: 10px;
  padding: 18px 20px;
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: 16px;
  color: var(--dim);
}
.kids-seo h2 {
  font-family: 'Syne', sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
}
.kids-seo p {
  font-size: 0.82rem;
  line-height: 1.7;
}

/* ── Overlay ── */
.kids-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(14px);
  z-index: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.25s ease both;
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ── Result card ── */
.kids-result-card {
  background: rgba(12, 12, 40, 0.98);
  border: 2px solid rgba(168, 85, 247, 0.3);
  border-radius: 28px;
  padding: 44px 36px 36px;
  max-width: 340px;
  width: calc(100% - 32px);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  animation: resultPop 0.45s cubic-bezier(0.34, 1.56, 0.64, 1) both;
  position: relative;
}
@keyframes resultPop {
  from { opacity: 0; transform: scale(0.6) rotate(-5deg); }
  to   { opacity: 1; transform: scale(1) rotate(0); }
}

.kids-result-emoji {
  font-size: 5rem;
  line-height: 1;
  animation: emojiBounce 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) 0.15s both;
}
@keyframes emojiBounce {
  from { transform: scale(0) rotate(-20deg); }
  to   { transform: scale(1) rotate(0); }
}

.kids-result-card h2 {
  font-family: 'Syne', sans-serif;
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--text);
}

/* ── Confetti burst ── */
.confetti-burst {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  pointer-events: none;
}
.confetti-dot {
  position: absolute;
  font-size: 1.1rem;
  transform: translate(-50%, -50%);
  animation: confettiFly var(--dur, 0.8s) ease-out var(--delay, 0s) both;
}
@keyframes confettiFly {
  0%   { transform: translate(-50%, -50%) rotate(0deg) scale(1); opacity: 1; }
  100% {
    transform:
      translate(
        calc(-50% + cos(var(--angle)) * var(--dist)),
        calc(-50% + sin(var(--angle)) * var(--dist))
      )
      rotate(360deg)
      scale(0);
    opacity: 0;
  }
}

/* ── Play again button ── */
.btn-kids-play-again {
  background: linear-gradient(135deg, #7c3aed 0%, #a855f7 50%, #ec4899 100%);
  border: none;
  border-radius: 100px;
  color: #fff;
  cursor: pointer;
  font-family: 'Syne', sans-serif;
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  padding: 14px 36px;
  transition: all var(--t);
  box-shadow: 0 6px 24px rgba(168, 85, 247, 0.4);
  width: 100%;
}
.btn-kids-play-again:hover {
  transform: translateY(-3px) scale(1.03);
  box-shadow: 0 10px 32px rgba(168, 85, 247, 0.55);
  filter: brightness(1.08);
}
.btn-kids-play-again:active {
  transform: translateY(-1px) scale(0.99);
}

/* ── Responsive ── */
@media (max-width: 400px) {
  .kids-board {
    width: min(270px, calc(100vw - 40px));
    gap: 8px;
  }
  .kids-cell { font-size: 2.4rem; border-radius: 10px; }
  .kids-score-bar { padding: 12px 14px; gap: 12px; }
  .kids-symbol { font-size: 1.6rem; }
  .kids-score-val { font-size: 1.6rem; }
  .symbol-pairs { gap: 6px; }
  .symbol-pair { font-size: 0.95rem; padding: 6px 12px; }
  .mode-selector { flex-direction: column; align-items: center; }
  .mode-btn { max-width: 100%; width: 100%; }
  .kids-result-card { padding: 34px 22px 26px; }
  .kids-result-emoji { font-size: 4rem; }
  .kids-result-card h2 { font-size: 1.4rem; }
}

@media (max-width: 340px) {
  .kids-header { padding: 10px 12px; }
  .kids-title { font-size: 1.2rem; }
  .btn-back-kids { font-size: 0.75rem; padding: 6px 10px; }
}
