:root {
  --primary: #7c3aed;
  --secondary: #ec4899;
  --accent: #f59e0b;
  --success: #10b981;
  --danger: #ef4444;
  --bg: #ede9e1;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: var(--bg);
  min-height: 100vh;
  overflow-x: hidden;
  background-image: radial-gradient(circle at 20% 20%, #e8e2d6 0%, transparent 50%),
                    radial-gradient(circle at 80% 80%, #e4ddd3 0%, transparent 50%);
}
h1 {
  text-align: center; padding: 20px 16px 4px; font-size: 2rem;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.tagline { text-align: center; font-size: 0.85rem; color: #a78bfa; margin-bottom: 16px; letter-spacing: 0.04em; }

.screen { display: none; max-width: 680px; margin: 0 auto; padding: 16px; }
.screen.active { display: block; }
.subtitle {
  text-align: center; margin-bottom: 16px; font-size: 1rem; font-weight: 800;
  font-family: 'Nunito', 'Arial Rounded MT Bold', cursive, sans-serif;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}

/* ── TABLES ── */
.tables-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; margin-bottom: 20px; }
.table-btn {
  aspect-ratio: 1; border: 3px solid #e5d5ff; border-radius: 16px; background: white;
  font-size: 1.5rem; font-weight: 800; color: #7c3aed; cursor: pointer;
  transition: all 0.15s; display: flex; align-items: center; justify-content: center;
  user-select: none; box-shadow: 0 2px 6px rgba(124,58,237,0.08);
}
.table-btn:hover { transform: scale(1.08); border-color: var(--primary); }
.table-btn.selected {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-color: transparent; color: white;
  box-shadow: 0 4px 14px rgba(124,58,237,0.45); transform: scale(1.08);
}
.select-actions { display: flex; gap: 10px; justify-content: center; margin-bottom: 18px; }
.btn-text {
  background: none; border: 2px solid #d8b4fe; border-radius: 20px; padding: 6px 16px;
  color: var(--primary); font-size: 0.85rem; font-weight: 600; cursor: pointer; transition: all 0.15s;
}
.btn-text:hover { background: #f5f0ff; }

/* ── QUESTION COUNT ── */
.qcount-row { display: flex; gap: 8px; justify-content: center; margin-bottom: 18px; flex-wrap: wrap; }
.qcount-btn {
  padding: 8px 18px; border: 3px solid #e5d5ff; border-radius: 20px; background: white;
  font-size: 1rem; font-weight: 700; color: #7c3aed; cursor: pointer; transition: all 0.15s;
}
.qcount-btn:hover { border-color: var(--primary); background: #f9f5ff; }
.qcount-btn.selected {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-color: transparent; color: white; box-shadow: 0 3px 10px rgba(124,58,237,0.35);
}

/* ── PLAYER ── */
.player-row { margin-bottom: 18px; }
.player-input {
  width: 100%; padding: 12px 16px; font-size: 1.1rem; font-weight: 600;
  border: 3px solid #e5d5ff; border-radius: 14px; outline: none;
  color: #1f2937; transition: border-color .15s; text-align: center;
  font-family: inherit;
}
.player-input:focus { border-color: var(--primary); }

/* ── DIFF HINT ── */
.diff-hint {
  text-align: center; font-size: 0.78rem; color: #a78bfa;
  font-family: 'DM Mono', monospace; margin: -8px 0 14px; min-height: 18px;
}

/* ── MODE ── */
.mode-selector { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 20px; }
.mode-card {
  flex: 1; min-width: calc(50% - 6px); border: 3px solid #e5d5ff; border-radius: 16px; padding: 14px;
  cursor: pointer; transition: all 0.15s; text-align: center; background: white;
}
.mode-card:hover { border-color: var(--primary); }
.mode-card.selected { border-color: var(--primary); background: #f5f0ff; }
.mode-card .mode-icon { font-size: 1.8rem; margin-bottom: 4px; }
.mode-card .mode-name { font-weight: 700; color: #374151; font-size: 0.9rem; }
.mode-card .mode-desc { font-size: 0.75rem; color: #9ca3af; margin-top: 2px; }

.btn-start {
  width: 100%; padding: 16px; font-size: 1.2rem; font-weight: 700; color: white;
  background: linear-gradient(135deg, var(--primary), var(--secondary)); border: none;
  border-radius: 20px; cursor: pointer; box-shadow: 0 6px 20px rgba(124,58,237,0.4);
  transition: transform 0.15s, box-shadow 0.15s; margin-bottom: 10px;
}
.btn-start:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(124,58,237,0.5); }
.btn-start:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }
.btn-history {
  width: 100%; padding: 12px; font-size: 1rem; font-weight: 600;
  border: 3px solid #e5d5ff; border-radius: 16px; background: white;
  color: var(--primary); cursor: pointer; transition: all 0.15s;
}
.btn-history:hover { background: #f5f0ff; border-color: var(--primary); }

/* ── QUIZ HEADER ── */
.quiz-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.btn-back {
  background: white; border: 2px solid #e5d5ff; border-radius: 12px; padding: 8px 14px;
  color: var(--primary); font-weight: 600; font-size: 0.85rem; cursor: pointer; transition: all 0.15s;
}
.btn-back:hover { background: #f5f0ff; }
.progress-wrap { flex: 1; margin: 0 12px; }
.progress-bar-bg { height: 12px; background: #e5d5ff; border-radius: 99px; overflow: hidden; }
.progress-bar {
  height: 100%; background: linear-gradient(90deg, var(--primary), var(--secondary));
  border-radius: 99px; transition: width 0.4s ease;
}
.progress-label { font-size: 0.75rem; color: #9ca3af; text-align: center; margin-top: 4px; }
.score-badge {
  background: linear-gradient(135deg, var(--accent), #f97316); color: white;
  font-weight: 700; font-size: 0.9rem; padding: 6px 12px; border-radius: 20px; white-space: nowrap;
}
.chrono-badge {
  background: #f1f5f9; border: 2px solid #e2e8f0;
  font-family: 'DM Mono', monospace; font-weight: 600; font-size: 0.85rem;
  padding: 5px 10px; border-radius: 20px; white-space: nowrap; color: #475569;
}
.stars-row { display: flex; justify-content: center; gap: 6px; margin-bottom: 10px; font-size: 1.4rem; }
.star.earned { animation: pop 0.4s ease; }
@keyframes pop { 0%{transform:scale(0)} 70%{transform:scale(1.4)} 100%{transform:scale(1)} }

/* ── KAWAII PANDA ── */
.panda-wrap { display: flex; justify-content: center; margin-bottom: 8px; }
.panda-img { width: 200px; height: 200px; object-fit: cover; }
.panda-img-lg { width: 240px; height: 240px; object-fit: cover; }
.panda-img-sm { width: 70px;  height: 70px;  object-fit: cover; }

.panda-img.anim-happy   { animation: pandaJump  0.55s cubic-bezier(0.34,1.56,0.64,1) forwards; }
.panda-img.anim-sad     { animation: pandaShake 0.5s ease forwards; }
.panda-img.anim-victory { animation: pandaJump  0.6s cubic-bezier(0.34,1.56,0.64,1) 0.2s both; }

@keyframes pandaJump {
  0%  { transform: translateY(0)     scale(1); }
  40% { transform: translateY(-18px) scale(1.08, 0.94); }
  70% { transform: translateY(4px)   scale(0.95, 1.05); }
  100%{ transform: translateY(0)     scale(1); }
}
@keyframes pandaShake {
  0%,100%{ transform: rotate(0deg); }
  20%    { transform: rotate(-9deg); }
  40%    { transform: rotate(9deg); }
  60%    { transform: rotate(-6deg); }
  80%    { transform: rotate(6deg); }
}

/* ── QUESTION CARD ── */
.question-card {
  background: white; border-radius: 24px; padding: 24px 24px 20px; text-align: center;
  box-shadow: 0 8px 30px rgba(124,58,237,0.12); margin-bottom: 18px;
}
.question-label { font-size: 0.85rem; color: #9ca3af; margin-bottom: 8px; text-transform: uppercase; letter-spacing: 0.05em; }
.question-text { font-size: 3rem; font-weight: 800; color: #1f2937; }
.question-text span { color: var(--primary); }

/* ── ANSWERS ── */
.answers-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.answer-btn {
  padding: 16px; font-size: 1.5rem; font-weight: 700; background: white;
  border: 3px solid #e5d5ff; border-radius: 18px; color: #374151;
  cursor: pointer; transition: all 0.15s; box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}
.answer-btn:hover:not(:disabled) { border-color: var(--primary); transform: scale(1.04); background: #f9f5ff; }
.answer-btn.correct { background: #d1fae5; border-color: var(--success); color: var(--success); animation: pop 0.4s; }
.answer-btn.wrong   { background: #fee2e2; border-color: var(--danger); color: var(--danger); animation: shake 0.4s; }
.answer-btn:disabled { cursor: default; }
@keyframes shake { 0%,100%{transform:translateX(0)} 25%{transform:translateX(-8px)} 75%{transform:translateX(8px)} }

.input-row { display: flex; gap: 10px; align-items: center; }
.answer-input {
  flex: 1; padding: 16px; font-size: 1.8rem; font-weight: 700; text-align: center;
  border: 3px solid #e5d5ff; border-radius: 16px; outline: none; transition: border-color 0.15s; color: #1f2937;
}
.answer-input:focus   { border-color: var(--primary); }
.answer-input.correct { border-color: var(--success); background: #d1fae5; color: var(--success); }
.answer-input.wrong   { border-color: var(--danger); background: #fee2e2; color: var(--danger); animation: shake 0.4s; }
.btn-validate {
  padding: 16px 24px; font-size: 1.2rem;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white; border: none; border-radius: 16px; cursor: pointer; font-weight: 700; transition: all 0.15s;
}
.btn-validate:hover { transform: scale(1.05); }
.feedback-msg { min-height: 32px; text-align: center; font-weight: 700; font-size: 1.05rem; margin-top: 12px; }
.feedback-msg.ok  { color: var(--success); }
.feedback-msg.nok { color: #f59e0b; }
.btn-next { display:none; margin: 14px auto 0; padding: 14px 32px; font-size: 1.1rem; font-weight: 700; background: linear-gradient(135deg, var(--primary), var(--secondary)); color: #fff; border: none; border-radius: 16px; cursor: pointer; box-shadow: 0 4px 12px rgba(124,58,237,0.25); transition: transform 0.1s; }
.btn-next:active { transform: scale(0.96); }
.retry-badge {
  display: inline-block; background: #fff7ed; border: 2px solid #f59e0b;
  color: #d97706; font-size: 0.78rem; font-weight: 700; padding: 3px 10px;
  border-radius: 20px; margin-bottom: 8px; letter-spacing: 0.02em;
}

/* ── RESULTS ── */
.result-card {
  background: white; border-radius: 24px; padding: 32px 24px; text-align: center;
  box-shadow: 0 8px 30px rgba(124,58,237,0.12); margin-bottom: 20px;
}
.result-panda-wrap { display: flex; justify-content: center; margin-bottom: 8px; }
.result-title {
  font-size: 1.8rem; font-weight: 800;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; margin-bottom: 6px;
}
.result-score { font-size: 3rem; font-weight: 900; color: #1f2937; margin: 12px 0 4px; }
.result-sub   { color: #6b7280; font-size: 0.95rem; margin-bottom: 16px; }
.result-stars { display: flex; justify-content: center; gap: 8px; font-size: 2.2rem; margin-bottom: 20px; }
.result-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 20px; }
.stat-box { background: #f9f5ff; border-radius: 16px; padding: 14px 8px; }
.stat-val { font-size: 1.6rem; font-weight: 800; color: var(--primary); }
.stat-lbl { font-size: 0.75rem; color: #9ca3af; margin-top: 2px; }
.result-actions { display: flex; gap: 12px; }
.btn-outline {
  flex: 1; padding: 14px; font-size: 1rem; font-weight: 700;
  border: 3px solid var(--primary); color: var(--primary);
  background: white; border-radius: 16px; cursor: pointer; transition: all 0.15s;
}
.btn-outline:hover { background: #f5f0ff; }
.btn-filled {
  flex: 1; padding: 14px; font-size: 1rem; font-weight: 700;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white; border: none; border-radius: 16px; cursor: pointer; transition: all 0.15s;
}
.btn-filled:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(124,58,237,0.4); }

/* ── HISTORY ── */
.history-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.history-title { font-size: 1.4rem; font-weight: 800; color: #1f2937; }
.btn-clear-all {
  background: none; border: 2px solid #fca5a5; border-radius: 12px; padding: 6px 14px;
  color: var(--danger); font-size: 0.8rem; font-weight: 600; cursor: pointer; transition: all 0.15s;
}
.btn-clear-all:hover { background: #fee2e2; }
.history-empty { text-align: center; padding: 48px 16px; color: #9ca3af; }
.history-empty .empty-icon { font-size: 3rem; margin-bottom: 12px; }
.history-list { display: flex; flex-direction: column; gap: 10px; }
.history-entry {
  background: white; border-radius: 18px; padding: 14px 16px;
  box-shadow: 0 2px 10px rgba(124,58,237,0.08); border: 2px solid #f0e6ff;
  display: flex; align-items: center; gap: 12px; cursor: pointer; transition: all 0.15s;
}
.history-entry:hover { border-color: var(--primary); transform: translateX(3px); }
.history-panda-mini { width: 52px; height: 52px; flex-shrink: 0; overflow: visible; }
.history-info { flex: 1; min-width: 0; }
.history-date { font-size: 0.75rem; color: #9ca3af; margin-bottom: 3px; }
.history-tables { font-size: 0.85rem; font-weight: 600; color: var(--primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 3px; }
.history-mode { font-size: 0.75rem; color: #9ca3af; }
.history-score { text-align: right; flex-shrink: 0; }
.history-score-val { font-size: 1.3rem; font-weight: 800; color: #1f2937; }
.history-score-pct { font-size: 0.8rem; color: #9ca3af; }
.history-stars { font-size: 0.9rem; }
.btn-delete {
  background: none; border: none; cursor: pointer; color: #d1d5db; font-size: 1.2rem;
  padding: 4px 6px; border-radius: 8px; transition: all 0.15s; flex-shrink: 0;
}
.btn-delete:hover { color: var(--danger); background: #fee2e2; }

/* ── DETAIL ── */
.detail-meta { background: #f9f5ff; border-radius: 14px; padding: 12px 16px; margin-bottom: 16px; text-align: left; }
.detail-meta-row { display: flex; justify-content: space-between; font-size: 0.9rem; margin-bottom: 4px; }
.detail-meta-row:last-child { margin-bottom: 0; }
.detail-meta-label { color: #9ca3af; }
.detail-meta-value { font-weight: 600; color: #374151; }

/* ── QUESTION LOG ── */
.qlog { margin-top: 16px; text-align: left; }
.qlog-title { font-weight: 700; color: #374151; font-size: 0.95rem; margin-bottom: 8px; }
.qlog-grid {
  display: grid;
  grid-template-columns: 1fr auto auto auto;
  gap: 4px 12px;
  font-size: 0.9rem;
  align-items: center;
}
.qlog-header { font-weight: 700; color: #9ca3af; font-size: 0.75rem; padding-bottom: 4px; border-bottom: 2px solid #f0e6ff; }
.qlog-row-ok  { color: #065f46; }
.qlog-row-nok { color: #991b1b; }
.qlog-q { font-weight: 600; }
.qlog-given { text-align: right; }
.qlog-time  { text-align: right; color: #9ca3af; font-size: 0.8rem; font-family: monospace; }
.qlog-icon  { text-align: center; font-size: 1rem; }
.qlog-sep { grid-column: 1/-1; height: 1px; background: #f0e6ff; }

/* ── CONFETTI / STREAK ── */
#confetti-canvas { position: fixed; inset: 0; pointer-events: none; z-index: 999; }
.streak-badge {
  display: none; position: fixed; top: 50%; left: 50%;
  transform: translate(-50%, -50%) scale(0);
  background: linear-gradient(135deg, var(--accent), #f97316);
  color: white; font-size: 1.4rem; font-weight: 800; padding: 16px 28px; border-radius: 20px;
  z-index: 100; box-shadow: 0 8px 30px rgba(249,115,22,0.5);
  transition: transform 0.3s cubic-bezier(0.34,1.56,0.64,1); text-align: center;
}
.streak-badge.show { display: block; transform: translate(-50%, -50%) scale(1); }

/* ── VISUAL HINT ── */
.visual-hint {
  width: 100%; max-width: 420px; margin: 14px auto 0;
  background: #fff; padding: 12px 16px;
  border: 2px dashed #e5d5ff; border-radius: 16px;
  box-shadow: 0 4px 16px rgba(124,58,237,0.10);
  animation: hintFadeIn 0.4s ease;
}
@keyframes hintFadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.hint-label {
  font-size: 0.72rem; color: #a78bfa; text-align: center;
  font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 8px;
}
.hint-addition {
  text-align: center; font-size: 1rem; font-weight: 700;
  color: #7c3aed; margin-bottom: 10px; line-height: 1.6; word-break: break-word;
}
.hint-dots { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.hint-dots-row { display: flex; gap: 4px; }
.hint-dot {
  width: 12px; height: 12px; border-radius: 50%; opacity: 0.8;
  transition: transform 0.1s;
}

/* ── PROFILES SELECTION SCREEN ── */
.profiles-title {
  text-align:center; font-size:1.8rem; font-weight:900; margin-bottom:20px;
  font-family: 'Nunito', 'Arial Rounded MT Bold', cursive, sans-serif;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.profiles-list { display:flex; flex-direction:column; gap:10px; margin-bottom:16px; }
.profile-card {
  background: linear-gradient(135deg, #faf5ff 0%, #fdf2f8 100%);
  border-radius:18px; padding:14px 16px;
  box-shadow:0 4px 14px rgba(124,58,237,0.12); border:2px solid #e9d5ff;
  display:flex; align-items:center; gap:12px; cursor:pointer; transition:all 0.2s;
}
.profile-card:hover { border-color:var(--primary); transform:translateX(4px); box-shadow:0 6px 20px rgba(124,58,237,0.2); }
.profile-card-avatar { font-size:2.4rem; flex-shrink:0; }
.profile-card-info { flex:1; }
.profile-card-name {
  font-size:1.25rem; font-weight:900;
  font-family: 'Nunito', 'Arial Rounded MT Bold', cursive, sans-serif;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.profile-card-sub { font-size:0.78rem; color:#a78bfa; margin-top:2px; font-weight:600; }
.profile-card-badges { display:flex; flex-wrap:wrap; gap:2px; margin-top:5px; font-size:1.15rem; line-height:1; }
.profile-card-play {
  background:linear-gradient(135deg,var(--primary),var(--secondary));
  color:white; border:none; border-radius:12px; padding:8px 16px;
  font-weight:700; font-size:0.9rem; cursor:pointer; flex-shrink:0;
}
.btn-delete-profile {
  background:none; border:none; cursor:pointer; color:#d1d5db; font-size:1.2rem;
  padding:4px 6px; border-radius:8px; transition:all 0.15s; flex-shrink:0;
}
.btn-delete-profile:hover { color:var(--danger); background:#fee2e2; }
.new-profile-form {
  background:white; border-radius:18px; padding:16px;
  box-shadow:0 2px 10px rgba(124,58,237,0.08); border:2px solid #e5d5ff;
  display:none; margin-bottom:12px;
}
.new-profile-form .input-row { gap:8px; }
.btn-new-profile {
  width:100%; padding:12px; font-size:1rem; font-weight:700;
  border:3px dashed #c4b5fd; border-radius:16px; background:transparent;
  color:var(--primary); cursor:pointer; transition:all 0.15s;
}
.btn-new-profile:hover { background:#f5f0ff; border-color:var(--primary); }

/* ── AVATAR PICKER ── */
.avatar-picker { display:flex; flex-wrap:wrap; gap:6px; justify-content:center; margin:10px 0 14px; }
.avatar-opt {
  font-size:1.8rem; cursor:pointer; padding:5px; border-radius:12px;
  border:3px solid transparent; transition:all 0.15s; line-height:1;
}
.avatar-opt:hover { background:#f5f0ff; transform:scale(1.2); }
.avatar-opt.selected { border-color:var(--primary); background:#ede9fe; transform:scale(1.15); }
.avatar-change-btn {
  display:inline-block; font-size:0.72rem; font-weight:700; color:#a78bfa;
  cursor:pointer; border:none; background:none; padding:2px 8px;
  border-radius:8px; transition:all 0.15s;
}
.avatar-change-btn:hover { background:#f5f0ff; color:var(--primary); }

/* ── PLAYER CHIP (setup screen) ── */
.player-chip {
  display:flex; align-items:center; gap:10px;
  background: linear-gradient(135deg, #f5f0ff, #fdf2f8);
  border:2px solid #d8b4fe; border-radius:16px; padding:12px 16px;
  margin-bottom:18px; box-shadow: 0 3px 10px rgba(124,58,237,0.1);
}
.player-chip-avatar { font-size:1.8rem; }
.player-chip-name {
  flex:1; font-weight:900; font-size:1.15rem;
  font-family: 'Nunito', 'Arial Rounded MT Bold', cursive, sans-serif;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.btn-change-player {
  background:none; border:2px solid #e5d5ff; border-radius:10px;
  padding:5px 12px; font-size:0.8rem; font-weight:600; color:#9ca3af;
  cursor:pointer; transition:all 0.15s;
}
.btn-change-player:hover { border-color:var(--primary); color:var(--primary); }

/* ── PROFILE BUTTON ── */
.btn-profile {
  width: 100%; padding: 12px; font-size: 1rem; font-weight: 700;
  border: 3px solid #a78bfa; border-radius: 16px; background: #f5f0ff;
  color: var(--primary); cursor: pointer; transition: all 0.15s; margin-top: 8px;
}
.btn-profile:hover { background: #ede9fe; border-color: var(--primary); }

/* ── PROFILE SCREEN ── */
.profile-header { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.profile-hero {
  text-align: center; margin-bottom: 20px;
  background: linear-gradient(135deg, #7c3aed 0%, #ec4899 50%, #f59e0b 100%);
  border-radius: 24px; padding: 22px 16px 18px;
  box-shadow: 0 6px 24px rgba(124,58,237,0.25);
}
.profile-hero-avatar { font-size: 3rem; margin-bottom: 6px; }
.profile-hero-name {
  font-family: 'Nunito', 'Varela Round', 'Arial Rounded MT Bold', 'Trebuchet MS', cursive, sans-serif;
  font-size: 3rem; font-weight: 900; color: white;
  text-shadow: 3px 4px 0px rgba(80,0,120,0.3), 0 0 30px rgba(255,255,255,0.2);
  letter-spacing: 0.06em;
  -webkit-text-stroke: 1px rgba(255,255,255,0.4);
}
.profile-hero-sub { color: rgba(255,255,255,0.85); font-size: 0.88rem; margin-top: 4px; font-weight: 600; }
.profile-stats-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 18px; }
.pstat-box {
  background: white; border-radius: 14px; padding: 12px 8px; text-align: center;
  box-shadow: 0 2px 8px rgba(124,58,237,0.08); border: 2px solid #f0e6ff;
}
.pstat-val { font-size: 1.5rem; font-weight: 800; color: var(--primary); }
.pstat-lbl { font-size: 0.7rem; color: #9ca3af; margin-top: 2px; }

/* ── PYTHAGORAS GRID ── */
.pytha-title { font-weight: 700; color: #374151; font-size: 0.95rem; margin-bottom: 10px; text-align: center; }
.pytha-wrap { overflow-x: auto; margin-bottom: 16px; }
.pytha-grid { display: grid; grid-template-columns: 28px repeat(10, 1fr); gap: 3px; min-width: 320px; }
.pytha-cell {
  aspect-ratio: 1; display: flex; align-items: center; justify-content: center;
  border-radius: 7px; font-size: 0.72rem; font-weight: 700; transition: transform 0.15s;
}
.pytha-cell:hover { transform: scale(1.15); z-index: 1; }
.pytha-head {
  aspect-ratio: 1; display: flex; align-items: center; justify-content: center;
  font-size: 0.72rem; font-weight: 800; color: #9ca3af;
}
.pytha-lv0 { background: #f3f4f6; color: #d1d5db; }
.pytha-lv1 { background: #fef3c7; color: #92400e; }
.pytha-lv2 { background: #c4b5fd; color: #4c1d95; }
.pytha-lv3 { background: #7c3aed; color: white; }
.pytha-lv4 { background: #10b981; color: white; }

.pytha-legend { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin-bottom: 16px; }
.legend-item { display: flex; align-items: center; gap: 4px; font-size: 0.72rem; color: #6b7280; }
.legend-dot { width: 14px; height: 14px; border-radius: 4px; flex-shrink: 0; }

/* ── TABLE BTN STATES ── */
.table-btn { position: relative; }
.table-btn.eval-ready { border-color: #f59e0b; background: #fffbeb; animation: pulseGold 1.8s ease-in-out infinite; }
.table-btn.eval-ready.selected { background: linear-gradient(135deg, #f59e0b, #f97316) !important; border-color: transparent !important; animation: none; }
.table-btn.eval-mastered-table { border-color: #10b981; background: #ecfdf5; color: #065f46; }
.table-btn.eval-mastered-table.selected { background: linear-gradient(135deg, #10b981, #059669) !important; border-color: transparent !important; color: white !important; }
@keyframes pulseGold {
  0%,100% { box-shadow: 0 0 0 2px rgba(245,158,11,0.2); }
  50%     { box-shadow: 0 0 0 5px rgba(245,158,11,0.5); }
}
.table-btn-badge {
  position: absolute; top: -7px; right: -7px; font-size: 0.6rem; font-weight: 800;
  width: 16px; height: 16px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  border: 1.5px solid white;
}
.table-btn-badge.ready { background: #f59e0b; color: white; }
.table-btn-badge.done  { background: #10b981; color: white; }

/* ── BADGES ── */
.badges-section { margin-bottom: 20px; }
.badges-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.badge-card {
  background: white; border-radius: 14px; padding: 10px 4px 8px; text-align: center;
  border: 2px solid #e5d5ff; box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  transition: transform 0.15s;
}
.badge-card.earned {
  border-color: transparent;
  box-shadow: 0 4px 16px rgba(0,0,0,0.13);
}
.badge-card.locked { filter: grayscale(1); opacity: 0.35; }
.badge-card.badge-new { animation: badgePop 0.55s cubic-bezier(0.34,1.56,0.64,1) both; }
@keyframes badgePop { 0%{transform:scale(0)} 100%{transform:scale(1)} }
.badge-emoji { font-size: 1.6rem; margin-bottom: 2px; }
.badge-table-label { font-size: 0.6rem; color: #a78bfa; font-weight: 800; text-transform: uppercase; letter-spacing: 0.04em; }
.badge-name { font-size: 0.62rem; font-weight: 700; color: #374151; margin-top: 1px; line-height: 1.3; }

/* ── HISTORY EVAL ENTRY ── */
.history-entry.eval-entry {
  border-color: #fcd34d;
  background: linear-gradient(135deg, #fffbeb, #fff7ed);
}
.history-entry.eval-entry:hover { border-color: #f59e0b; }
.history-eval-badge {
  font-size: 0.72rem; font-weight: 800; padding: 2px 8px; border-radius: 10px;
  margin-bottom: 3px; display: inline-block;
}
.history-eval-badge.pass { background: #d1fae5; color: #065f46; }
.history-eval-badge.fail { background: #fee2e2; color: #991b1b; }

/* ── HISTORY PAGINATION ── */
.history-pagination {
  display: flex; align-items: center; justify-content: center;
  gap: 8px; margin-top: 16px; flex-wrap: wrap;
}
.history-pg-btn {
  background: white; border: 2px solid #e5d5ff; border-radius: 12px;
  padding: 8px 16px; color: var(--primary); font-weight: 700;
  font-size: 0.9rem; cursor: pointer; transition: all 0.15s;
}
.history-pg-btn:hover:not(:disabled) { background: #f5f0ff; border-color: var(--primary); }
.history-pg-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.history-pg-info { font-size: 0.85rem; color: #9ca3af; font-weight: 600; padding: 0 4px; }

/* ── TOAST ── */
#toast-msg {
  position: fixed; bottom: 80px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: #1f2937; color: white; padding: 10px 20px; border-radius: 20px;
  font-size: 0.9rem; font-weight: 700; z-index: 999; opacity: 0;
  transition: opacity 0.3s, transform 0.3s; pointer-events: none;
}
#toast-msg.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ── EVAL MODE ── */
.mode-card.locked { opacity: 0.4; cursor: not-allowed; pointer-events: none; }
.mode-card.locked:hover { border-color: #e5d5ff; transform: none; background: white; }
.eval-section {
  background: linear-gradient(135deg, #fef9c3, #fff7ed);
  border: 2px solid #fcd34d; border-radius: 20px; padding: 16px; margin-bottom: 18px;
}
.eval-section-title { text-align: center; font-weight: 800; color: #b45309; font-size: 0.88rem; margin-bottom: 10px; }
.eval-table-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin-bottom: 12px; }
.eval-table-btn {
  aspect-ratio: 1; border: 2px solid #fcd34d; border-radius: 12px; background: white;
  font-size: 1.2rem; font-weight: 800; color: #b45309; cursor: pointer;
  transition: all 0.15s; display: flex; align-items: center; justify-content: center; position: relative;
}
.eval-table-btn:hover { border-color: #f59e0b; transform: scale(1.07); }
.eval-table-btn.selected {
  background: linear-gradient(135deg, #f59e0b, #f97316); border-color: transparent; color: white;
  box-shadow: 0 3px 10px rgba(245,158,11,0.4); transform: scale(1.07);
}
.eval-table-btn.eval-done { border-color: #10b981; background: #ecfdf5; color: #065f46; }
.eval-mastered-tag {
  position: absolute; top: -6px; right: -6px; font-size: 0.58rem;
  background: #10b981; color: white; border-radius: 6px; padding: 1px 4px; font-weight: 700; line-height: 1.4;
}
.btn-start-eval {
  width: 100%; padding: 13px; font-size: 1rem; font-weight: 700; color: white;
  background: linear-gradient(135deg, #f59e0b, #f97316); border: none;
  border-radius: 16px; cursor: pointer; box-shadow: 0 4px 12px rgba(245,158,11,0.4);
  transition: transform 0.15s, box-shadow 0.15s;
}
.btn-start-eval:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(245,158,11,0.5); }
.btn-start-eval:disabled { opacity: 0.4; cursor: not-allowed; transform: none; box-shadow: none; }
.eval-result-notice {
  margin: 12px 0 0; padding: 12px 16px; border-radius: 14px;
  font-weight: 700; font-size: 0.95rem; text-align: center;
}

/* ── HARDCORE ── */
.hardcore-timer { margin-bottom: 10px; text-align: center; }
.hardcore-countdown {
  font-size: 2.8rem; font-weight: 900; color: var(--primary);
  font-family: 'DM Mono', monospace; line-height: 1;
  transition: color 0.3s;
}
.hardcore-countdown.urgent { color: var(--danger); animation: hardcorePulse 0.4s ease-in-out infinite; }
.hardcore-bar-bg { height: 8px; background: #e5d5ff; border-radius: 99px; overflow: hidden; margin-top: 6px; }
.hardcore-bar {
  height: 100%; border-radius: 99px;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  transition: width 1s linear;
}
.hardcore-bar.urgent { background: var(--danger); }
@keyframes hardcorePulse { 0%,100%{transform:scale(1)} 50%{transform:scale(1.15)} }
.hardcore-death-banner {
  text-align: center; font-size: 1.5rem; font-weight: 900; color: var(--danger);
  margin-bottom: 8px; animation: pop 0.5s ease;
}

/* ── LEADERBOARD ── */
.leaderboard-title { text-align: center; font-size: 1.4rem; font-weight: 900; color: #1e1b4b; margin-bottom: 6px; }
.leaderboard-sub { text-align: center; font-size: 0.82rem; color: #9ca3af; margin-bottom: 20px; }
.leaderboard-list { display: flex; flex-direction: column; gap: 12px; }
.lb-entry {
  display: flex; align-items: center; gap: 14px;
  background: white; border-radius: 18px;
  padding: 14px 18px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.07);
  border: 2px solid transparent;
}
.lb-entry.rank-1 { border-color: #fbbf24; background: linear-gradient(135deg, #fffbeb, #ffffff); }
.lb-entry.rank-2 { border-color: #d1d5db; background: linear-gradient(135deg, #f9fafb, #ffffff); }
.lb-entry.rank-3 { border-color: #cd7c3a; background: linear-gradient(135deg, #fff7ed, #ffffff); }
.lb-rank { font-size: 1.6rem; width: 36px; text-align: center; flex-shrink: 0; }
.lb-avatar { font-size: 1.8rem; flex-shrink: 0; }
.lb-info { flex: 1; min-width: 0; }
.lb-name { font-weight: 800; font-size: 1rem; color: #1f2937; }
.lb-detail { font-size: 0.78rem; color: #6b7280; margin-top: 2px; }
.lb-score { text-align: right; flex-shrink: 0; }
.lb-score-main { font-size: 1.25rem; font-weight: 900; color: #7c3aed; }
.lb-score-time { font-size: 0.75rem; color: #9ca3af; margin-top: 2px; }
.lb-perfect { color: #10b981; }
.lb-empty { text-align: center; padding: 40px 0; color: #9ca3af; font-size: 0.95rem; }
.btn-leaderboard {
  display: block; width: 100%; margin-top: 12px; padding: 12px;
  font-size: 0.95rem; font-weight: 700; color: #7c3aed;
  background: #f5f0ff; border: 2px solid #e9d5ff;
  border-radius: 16px; cursor: pointer; transition: all 0.15s;
}
.btn-leaderboard:hover { background: #ede9fe; border-color: #c4b5fd; }

/* ── MODE BALLONS ── */
#screen-ballons {
  padding: 0; overflow: hidden;
  flex-direction: column; min-height: 100vh;
  background: linear-gradient(180deg, #e0f2fe 0%, #bae6fd 45%, #7dd3fc 100%);
}
#screen-ballons.active { display: flex; }
.ballon-header {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px;
  background: rgba(255,255,255,0.75); backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(255,255,255,0.5); flex-shrink: 0;
}
.ballon-lives { font-size: 1.25rem; flex: 1; text-align: center; letter-spacing: 3px; }
.ballon-score-wrap { text-align: right; }
.ballon-score-lbl { font-size: 0.65rem; color: #6b7280; text-transform: uppercase; letter-spacing: 1px; }
.ballon-score-val { font-size: 1.3rem; font-weight: 900; color: #1e1b4b; }
.ballon-question-wrap {
  text-align: center; padding: 12px 12px 8px;
  background: rgba(255,255,255,0.6); flex-shrink: 0;
}
.ballon-question { font-size: 2.4rem; font-weight: 900; color: #1e1b4b; line-height: 1; }
.ballon-qnum { font-size: 0.75rem; color: #6b7280; margin-top: 3px; }
.ballon-arena { position: relative; flex: 1; overflow: hidden; min-height: 260px; }
.ballon-feedback {
  position: absolute; top: 18%; left: 50%;
  transform: translateX(-50%) scale(1);
  font-size: 1.4rem; font-weight: 900;
  pointer-events: none; opacity: 0;
  transition: opacity 0.35s ease, transform 0.35s ease;
  z-index: 20; white-space: nowrap;
}
.ballon {
  position: absolute;
  width: 64px; height: 78px;
  border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.15rem; font-weight: 900; color: white;
  text-shadow: 0 1px 3px rgba(0,0,0,0.35);
  box-shadow: inset -6px -8px 0 rgba(0,0,0,0.12), 0 4px 14px rgba(0,0,0,0.18);
  user-select: none; -webkit-user-select: none;
  touch-action: manipulation; z-index: 5;
  animation: balloon-float linear both;
}
.ballon::before {
  content: ''; position: absolute;
  top: 14%; left: 18%; width: 26%; height: 30%;
  background: rgba(255,255,255,0.38);
  border-radius: 50%; transform: rotate(-35deg);
}
.ballon::after {
  content: ''; position: absolute;
  bottom: -21px; left: 50%; transform: translateX(-50%);
  width: 1.5px; height: 21px; background: rgba(0,0,0,0.22);
}
@keyframes balloon-float {
  0%   { bottom: -110px; opacity: 0; transform: translateX(0) rotate(0deg); }
  6%   { opacity: 1; }
  25%  { transform: translateX(5px) rotate(2.5deg); }
  50%  { transform: translateX(-4px) rotate(-2deg); }
  75%  { transform: translateX(6px) rotate(2.5deg); }
  100% { bottom: calc(100% + 40px); transform: translateX(2px) rotate(1deg); opacity: 1; }
}
.ballon.popped {
  animation: balloon-pop 0.26s ease-out forwards !important;
  pointer-events: none;
}
@keyframes balloon-pop {
  0%   { transform: scale(1); opacity: 1; }
  45%  { transform: scale(1.55); opacity: 0.7; }
  100% { transform: scale(0.05); opacity: 0; }
}
.ballon.wrong-tap {
  animation: balloon-wrong 0.32s ease forwards !important;
  pointer-events: none;
}
@keyframes balloon-wrong {
  0%   { transform: scale(1); opacity: 1; }
  35%  { transform: scale(0.85) rotate(-8deg); filter: brightness(0.55); }
  100% { transform: scale(0) rotate(12deg); opacity: 0; }
}
.ballon-gameover {
  display: none; position: absolute; inset: 0;
  background: rgba(255,255,255,0.93);
  flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 28px 24px;
  backdrop-filter: blur(4px); border-radius: 0;
}
.ballon-gameover.active { display: flex; }

/* ── PASSWORD MODAL ── */
.pwd-overlay {
  display: none; position: fixed; inset: 0; z-index: 200;
  background: rgba(0,0,0,0.45); align-items: center; justify-content: center;
}
.pwd-overlay.active { display: flex; }
.pwd-box {
  background: white; border-radius: 24px; padding: 28px 24px;
  width: min(320px, 90vw); text-align: center;
  box-shadow: 0 12px 40px rgba(0,0,0,0.2);
  animation: pop 0.25s ease;
}
.pwd-icon { font-size: 2.4rem; margin-bottom: 8px; }
.pwd-title { font-size: 1.1rem; font-weight: 800; color: #1e1b4b; margin-bottom: 4px; }
.pwd-sub { font-size: 0.8rem; color: #9ca3af; margin-bottom: 16px; }
.pwd-input {
  width: 100%; box-sizing: border-box; padding: 12px 14px;
  font-size: 1rem; border: 2px solid #e5d5ff; border-radius: 14px;
  outline: none; text-align: center; letter-spacing: 2px;
  transition: border-color 0.15s;
}
.pwd-input:focus { border-color: var(--primary); }
.pwd-input.error { border-color: var(--danger); animation: shake 0.35s ease; }
.pwd-error { font-size: 0.78rem; color: var(--danger); min-height: 18px; margin: 6px 0 10px; }
.pwd-actions { display: flex; gap: 10px; }
.pwd-actions .btn-filled { flex: 1; padding: 12px; font-size: 0.95rem; }
.pwd-actions .btn-text { flex: 1; padding: 12px; font-size: 0.9rem; color: #6b7280; background: none; border: none; cursor: pointer; }
.pwd-speed-label { font-size: 0.78rem; color: #6b7280; margin: 14px 0 6px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; }
.pwd-speed-btns { display: flex; gap: 8px; margin-bottom: 4px; }
.pwd-speed-btn {
  flex: 1; padding: 9px 4px; border: 2px solid #e5d5ff; border-radius: 12px;
  background: white; cursor: pointer; font-size: 0.82rem; font-weight: 700;
  color: #7c3aed; transition: all 0.15s;
}
.pwd-speed-btn:hover { border-color: var(--primary); background: #f5f0ff; }
.pwd-speed-btn.selected { background: var(--primary); border-color: var(--primary); color: white; }
.ballon-go-emoji { font-size: 3rem; margin-bottom: 8px; }
.ballon-go-title { font-size: 1.4rem; font-weight: 900; color: #1e1b4b; margin-bottom: 8px; }
.ballon-go-stats { font-size: 0.9rem; color: #6b7280; margin-bottom: 22px; line-height: 1.7; }
.ballon-gameover .btn-filled, .ballon-gameover .btn-profile { flex: none; }
.mode-card[data-mode="ballons"].selected { border-color: #3b82f6; background: #eff6ff; }
.mode-card[data-mode="ballons"].selected .mode-name { color: #1d4ed8; }

/* ── MODE MYSTERE ── */
#screen-mystere { padding: 0; overflow: hidden; flex-direction: column; min-height: 100vh; background: #f8f5ff; }
#screen-mystere.active { display: flex; }
.mystere-header {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; flex-shrink: 0;
  background: rgba(255,255,255,0.9); border-bottom: 1px solid #e5d5ff;
}
.mystere-progress { flex: 1; text-align: center; font-weight: 900; color: var(--primary); font-size: 1.05rem; }
.mystere-stars { font-size: 1.15rem; letter-spacing: 2px; }
.mystere-q-area {
  padding: 12px 16px 10px; text-align: center; flex-shrink: 0;
  background: white; border-bottom: 1px solid #f0ebff;
}
.mystere-q-label { font-size: 0.72rem; color: #9ca3af; margin-bottom: 4px; letter-spacing: 0.03em; text-transform: uppercase; }
.mystere-question { font-size: 2.4rem; font-weight: 900; color: #1e1b4b; line-height: 1; }
.mystere-image-wrap { flex: 1; display: flex; align-items: center; justify-content: center; padding: 14px; min-height: 0; }
.mystere-image-area {
  position: relative; width: 100%; border-radius: 22px; overflow: hidden;
  aspect-ratio: 1/1; max-height: 340px;
  box-shadow: 0 10px 36px rgba(0,0,0,0.18);
}
.mystere-center-emoji {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%);
  font-size: clamp(64px, 18vw, 110px); z-index: 1;
  user-select: none; pointer-events: none; line-height: 1;
}
#mystere-canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 2; border-radius: 22px; }
.mystere-block {
  position: absolute; z-index: 3;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; user-select: none; touch-action: manipulation;
  background: transparent; border: none;
  transition: transform 0.12s ease;
}
.mystere-block .mb-q {
  font-size: clamp(0.5rem, 2vw, 0.82rem); font-weight: 900; color: white;
  text-shadow: 0 1px 4px rgba(0,0,0,0.7); pointer-events: none; text-align: center; line-height: 1.2;
}
.mystere-block.active .mb-q { text-shadow: 0 0 10px rgba(255,255,255,0.9), 0 1px 4px rgba(0,0,0,0.7); }
.mystere-block.removed { pointer-events: none; }
.mystere-block.shake { animation: mystere-shake 0.36s ease !important; }
@keyframes mystere-shake {
  0%, 100% { transform: translateX(0); }
  22%      { transform: translateX(-7px) rotate(-2deg); }
  44%      { transform: translateX(7px) rotate(2deg); }
  66%      { transform: translateX(-4px); }
  88%      { transform: translateX(4px); }
}
.mystere-end-overlay {
  display: none; position: absolute; inset: 0; z-index: 10;
  background: rgba(255,255,255,0.93); backdrop-filter: blur(6px);
  flex-direction: column; align-items: center; justify-content: center;
  padding: 18px 20px; text-align: center; border-radius: 22px;
}
.mystere-end-overlay.active { display: flex; }
.mystere-end-emoji { font-size: 3.5rem; margin-bottom: 4px; }
.mystere-end-name { font-size: 1.4rem; font-weight: 900; color: #1e1b4b; margin-bottom: 3px; }
.mystere-end-desc { font-size: 0.82rem; color: #6b7280; margin-bottom: 10px; }
.mystere-end-stars { font-size: 1.9rem; letter-spacing: 4px; margin-bottom: 6px; }
.mystere-end-stats { font-size: 0.78rem; color: #9ca3af; margin-bottom: 14px; }
.mystere-end-overlay .btn-filled, .mystere-end-overlay .btn-profile { flex: none; width: 100%; margin-bottom: 8px; }
.mystere-feedback {
  position: absolute; top: 10px; left: 50%; transform: translateX(-50%);
  font-size: 1rem; font-weight: 900; color: white;
  padding: 4px 14px; border-radius: 20px;
  pointer-events: none; opacity: 0; z-index: 20; white-space: nowrap;
  transition: opacity 0.35s ease;
}
.mystere-input-row {
  display: flex; gap: 10px; padding: 12px 16px;
  background: white; border-top: 1px solid #f0ebff; flex-shrink: 0;
}
.mystere-input-row .answer-input { flex: 1; font-size: 1.5rem; text-align: center; padding: 10px 8px; }
.mystere-input-row .btn-validate { flex-shrink: 0; padding: 10px 22px; font-size: 1rem; }
.mode-card[data-mode="mystere"].selected { border-color: #f59e0b; background: #fffbeb; }
.mode-card[data-mode="mystere"].selected .mode-name { color: #d97706; }

@media (max-width: 480px) {
  h1 { font-size: 1.5rem; }
  .question-text { font-size: 2.2rem; }
  .answer-btn { font-size: 1.3rem; padding: 12px; }
  .tables-grid { gap: 6px; }
  .hint-dot { width: 9px; height: 9px; }
  .pytha-cell, .pytha-head { font-size: 0.6rem; border-radius: 5px; }
  .pytha-grid { gap: 2px; }
}

/* ── LIGHTBOX ── */
.lightbox-overlay {
  display: none; position: fixed; inset: 0; z-index: 300;
  background: rgba(0,0,0,0.82); align-items: center; justify-content: center;
  cursor: zoom-out;
}
.lightbox-overlay.active { display: flex; }
.lightbox-img {
  max-width: 92vw; max-height: 88vh; border-radius: 16px;
  box-shadow: 0 8px 48px rgba(0,0,0,0.6);
  animation: pop 0.2s ease;
  cursor: default;
}
.lightbox-close {
  position: fixed; top: 18px; right: 22px;
  background: rgba(255,255,255,0.15); border: none; color: white;
  font-size: 1.4rem; width: 40px; height: 40px; border-radius: 50%;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: background 0.15s;
}
.lightbox-close:hover { background: rgba(255,255,255,0.3); }

/* ── MYSTERE GALLERY ── */
.mystere-gallery {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px;
  margin-bottom: 18px;
}
.mystere-gallery-item {
  aspect-ratio: 1; border-radius: 14px; overflow: hidden;
  background: #f5f0ff; border: 2px solid #e5d5ff;
  position: relative; cursor: default;
  box-shadow: 0 2px 8px rgba(124,58,237,0.10);
}
.mystere-gallery-item img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.mystere-gallery-item .gallery-badge {
  position: absolute; bottom: 4px; right: 6px;
  font-size: 0.9rem; line-height: 1; filter: drop-shadow(0 1px 2px rgba(0,0,0,0.4));
}
.mystere-gallery-empty {
  grid-column: 1 / -1; text-align: center; padding: 20px 0;
  color: #a78bfa; font-size: 0.9rem; font-weight: 600;
}
