﻿:root {
  --primary: #1e3a5f;
  --primary-dark: #152b47;
  --primary-light: #e8eef5;
  --accent-c: #e67e22;
  --accent-d: #2563eb;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; background: #f1f5f9; min-height: 100vh; width: 100%; }

/* â”€â”€ SCREENS â”€â”€ */
.screen { display: none; width: 100%; }
.screen.active {
  display: flex; align-items: flex-start; justify-content: center;
  min-height: 100vh; padding: 16px;
  animation: screenIn .3s ease-out;
}
#screen-quiz.active, #screen-riepilogo.active {
  display: block; max-width: 1100px; margin: 0 auto; padding: 8px; min-height: unset;
}
#screen-result.active { display: flex; align-items: center; justify-content: center; }
#screen-argomento.active { display: block; }
@keyframes screenIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* â”€â”€ START BOX â”€â”€ */
.start-box {
  padding: 28px 24px; text-align: center;
  width: 100%; max-width: 1000px; margin: auto;
}
.start-box h1 { color: var(--primary); font-size: 1.8rem; margin-bottom: 4px; }
.start-box h1 span:first-of-type { color: var(--accent-c); }
.start-box h1 span:last-of-type  { color: var(--accent-d); }
.start-sub { color: #555; margin-bottom: 20px; font-size: .95rem; }

.top-bar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.back-hub {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 600; color: var(--primary);
  text-decoration: none; background: var(--primary-light);
  border-radius: 20px; padding: 5px 14px; transition: background .2s;
  border: none; cursor: pointer;
}
.back-hub:hover { background: #c8d4e3; }

/* â”€â”€ PATENTE CHOICE â”€â”€ */
.patente-choice { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 20px; }
@media (max-width: 480px) { .patente-choice { grid-template-columns: 1fr; } }
.choice-card {
  border: 3px solid #e2e8f0; border-radius: 14px;
  padding: 28px 20px; text-align: center;
  background: #fff; cursor: pointer;
  transition: transform .15s, border-color .15s, box-shadow .15s;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.choice-card:hover { transform: translateY(-3px); box-shadow: 0 6px 20px rgba(0,0,0,.15); }
.choice-c:hover { border-color: var(--accent-c); }
.choice-d:hover { border-color: var(--accent-d); }
.choice-icon { font-size: 3rem; }
.choice-title { font-size: 1.5rem; font-weight: 800; }
.choice-c .choice-title { color: var(--accent-c); }
.choice-d .choice-title { color: var(--accent-d); }
.choice-sub { font-size: .85rem; color: #666; line-height: 1.5; }

/* â”€â”€ INFO STRIP â”€â”€ */
.info-strip { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; margin-bottom: 20px; }
.info-strip span {
  background: var(--primary-light); color: var(--primary);
  border-radius: 20px; padding: 5px 14px; font-size: .82rem; font-weight: 600;
}

/* â”€â”€ MODE CARDS â”€â”€ */
.mode-cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; margin-bottom: 20px; }
@media (max-width: 480px) { .mode-cards { grid-template-columns: 1fr; } }
.mode-card {
  background: #fff; border: 1px solid #e2e8f0; border-radius: 12px;
  padding: 24px 20px; text-align: center;
  display: flex; flex-direction: column; gap: 12px;
  box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.mode-card:hover { border-color: var(--primary); transform: translateY(-3px); box-shadow: 0 10px 15px -3px rgba(0,0,0,0.08); }
.mode-icon { font-size: 2rem; }
.mode-title { font-size: 1rem; font-weight: bold; color: #222; }
.mode-desc { font-size: .8rem; color: #666; line-height: 1.5; }
.mode-card > *:last-child { margin-top: auto; }

/* â”€â”€ BUTTONS â”€â”€ */
.btn-primary {
  background: var(--primary); color: #fff; border: none;
  padding: 10px 22px; border-radius: 8px; font-size: .95rem; cursor: pointer; width: 100%;
  transition: background .2s, transform .15s;
}
.btn-primary:hover { background: var(--primary-dark); }
.btn-secondary-green {
  background: #10b981; color: #fff; border: none;
  padding: 10px 22px; border-radius: 8px; font-size: .95rem; cursor: pointer; width: 100%;
  transition: background .2s, transform .15s;
}
.btn-secondary-green:hover { background: #059669; }
.btn-ripasso {
  background: #8e44ad; color: #fff; border: none;
  padding: 10px 22px; border-radius: 8px; font-size: .95rem; cursor: pointer; width: 100%;
  transition: background .2s, transform .15s;
}
.btn-ripasso:hover { background: #7d3c98; }
.btn-secondary {
  background: #7f8c8d; color: #fff; border: none;
  padding: 8px 18px; border-radius: 8px; font-size: .9rem; cursor: pointer;
  transition: background .2s, transform .15s;
}
.btn-secondary:hover { background: #626c6d; }

/* â”€â”€ STATS STRIP â”€â”€ */
.stats-strip { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin-bottom: 16px; }
.stats-strip span { background: var(--primary-light); border: 1px solid #c5d0e0; border-radius: 20px; padding: 4px 12px; font-size: .8rem; color: #334; }
.stats-strip strong { color: var(--primary); }
.stat-chip--full { background: #eef1ff !important; border-color: #c9d2f5 !important; transition: all .2s; }
.stat-chip--full:hover { background: #dde4fb !important; transform: scale(1.03); }

/* â”€â”€ Modale statistiche complete â”€â”€ */
.stats-modal-h { margin: 0 0 8px; font-size: .9rem; color: #2563eb; }
.stats-modal-h:not(:first-child) { margin-top: 20px; }
.cat-stat-list { display: flex; flex-direction: column; gap: 6px; }
.cat-stat-row { display: grid; grid-template-columns: 1fr 90px 70px; align-items: center; gap: 8px; font-size: .8rem; }
.cat-stat-label { color: #334; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cat-stat-bar-wrap { background: #eee; border-radius: 6px; height: 10px; overflow: hidden; }
.cat-stat-bar { height: 100%; border-radius: 6px; transition: width .3s; }
.cat-stat-pct { text-align: right; font-weight: 600; color: #334; white-space: nowrap; }
.cat-stat-n { font-weight: 400; opacity: .6; font-size: .82em; }
.hist-list { display: flex; flex-direction: column; gap: 4px; }
.hist-row { display: grid; grid-template-columns: 1fr 70px 55px 50px; align-items: center; gap: 8px; font-size: .78rem; padding: 6px 8px; border-radius: 6px; background: #f8f9fb; border-left: 3px solid transparent; }
.hist-row.hist-pass { border-left-color: #10b981; }
.hist-row.hist-fail { border-left-color: #ef4444; }
.hist-date { color: #888; }
.hist-mode { color: #556; }
.hist-score { font-weight: 600; text-align: right; }
.hist-pct { text-align: right; color: #666; }
@media (max-width: 480px) {
  .cat-stat-row { grid-template-columns: 1fr 50px 75px; }
  .cat-stat-n { font-size: .7rem; }
  .hist-row { grid-template-columns: 1fr 50px 45px; }
  .hist-mode { display: none; }
}

/* â”€â”€ QUIZ MODE BAR â”€â”€ */
.quiz-mode-bar {
  padding: 8px 16px; margin-bottom: 8px;
  font-size: .85rem; font-weight: bold; border-radius: 8px; border: 1px solid transparent; text-align: center;
  background: var(--primary-light); color: var(--primary);
}

/* â”€â”€ NUM ROW â”€â”€ */
.num-row { display: grid; grid-template-columns: repeat(10, 1fr); gap: 3px; margin-bottom: 3px; }
.num-btn {
  text-align: center; padding: 8px 2px; border: 1px solid #e2e8f0; border-radius: 8px;
  font-size: .85rem; font-weight: bold; cursor: pointer;
  background: #ffffff; color: #64748b; user-select: none;
  transition: all .15s ease;
}
.num-btn:hover { background: #f8fafc; color: #1e293b; border-color: #cbd5e1; }
.num-btn.current  { background: var(--primary); color: #fff; border-color: var(--primary); }
.num-btn.correct  { background: #10b981; color: #fff; border-color: #10b981; }
.num-btn.wrong    { background: #ef4444; color: #fff; border-color: #ef4444; }
.num-btn.answered { background: #3b82f6; color: #fff; border-color: #3b82f6; }

/* â”€â”€ MAIN CONTENT â”€â”€ */
.main-content { display: grid; grid-template-columns: 220px 1fr; gap: 6px; margin-bottom: 5px; }
@media (max-width: 600px) { .main-content { grid-template-columns: 1fr; } }
.img-panel {
  border: 1px solid #e2e8f0; border-radius: 12px; background: #fff;
  box-shadow: 0 1px 3px 0 rgba(0,0,0,0.05);
  display: flex; align-items: center; justify-content: center; min-height: 150px;
}
.img-placeholder {
  display: flex; align-items: center; justify-content: center;
  width: 100%; height: 100%; color: #aaa; font-size: 2rem; padding: 8px;
}
.img-placeholder img { max-width: 100%; max-height: 180px; object-fit: contain; }
.q-panel { display: flex; flex-direction: column; gap: 6px; }
.q-header {
  background: #fff; border: 1px solid #e2e8f0; border-radius: 12px;
  box-shadow: 0 1px 3px 0 rgba(0,0,0,0.05);
  padding: 10px 12px 8px 12px; display: flex; flex-direction: column; gap: 6px; flex: 1;
  position: relative;
}
.q-footer-row { display: flex; align-items: center; justify-content: flex-end; gap: 6px; }
.btn-tts-q {
  background: none; border: none; font-size: 1.2rem;
  cursor: pointer; padding: 4px; line-height: 1;
  opacity: .5; transition: opacity .2s;
}
.btn-tts-q:hover, .btn-tts-q.tts-playing { opacity: 1; }
.q-text { font-size: 1.1rem; line-height: 1.6; color: #333; }
.q-num {
  border: 1px solid #e2e8f0; border-radius: 8px; padding: 2px 7px;
  font-size: .82rem; font-weight: bold; color: #475569; background: #f8fafc; white-space: nowrap;
}

/* â”€â”€ V/F BUTTONS â”€â”€ */
.vf-row {
  display: flex; gap: 20px; justify-content: center;
  background: #fff; border: 1px solid #e2e8f0; border-radius: 12px; padding: 12px;
  box-shadow: 0 1px 3px 0 rgba(0,0,0,0.05);
}
.btn-vf {
  width: 66px; height: 66px; border-radius: 50%;
  border: 2px solid #cbd5e1; background: #fff;
  font-size: 1.6rem; font-weight: bold; cursor: pointer; color: #475569; transition: all .2s ease;
  -webkit-tap-highlight-color: transparent; box-shadow: 0 1px 3px 0 rgba(0,0,0,0.05);
}
@media (hover: hover) {
  .btn-vf-v:hover:not(:disabled) { border-color: #10b981; color: #047857; background: #f0fdf4; transform: scale(1.05); }
  .btn-vf-f:hover:not(:disabled) { border-color: #ef4444; color: #ef4444; background: #fef2f2; transform: scale(1.05); }
}
.btn-vf-v:active:not(:disabled) { border-color: #10b981; color: #047857; background: #f0fdf4; transform: scale(0.95); }
.btn-vf-f:active:not(:disabled) { border-color: #ef4444; color: #ef4444; background: #fef2f2; transform: scale(0.95); }
#btn-V:active:not(:disabled) { border-color: #10b981; color: #047857; background: #f0fdf4; transform: scale(0.95); }
#btn-F:active:not(:disabled) { border-color: #ef4444; color: #ef4444; background: #fef2f2; transform: scale(0.95); }
.btn-vf.selected-correct { background: #10b981 !important; border-color: #10b981 !important; color: #fff !important; }
.btn-vf.selected-wrong   { background: #ef4444 !important; border-color: #ef4444 !important; color: #fff !important; }
.btn-vf.selected-pending { background: #3b82f6 !important; border-color: #3b82f6 !important; color: #fff !important; }
.btn-vf.unselected       { opacity: .35; transform: scale(0.95); }
.btn-vf:disabled         { cursor: default; }
.btn-vf.selected    { background: #3b82f6; border-color: #3b82f6; color: #fff; }
.btn-vf:disabled    { cursor: default; opacity: .85; }

/* â”€â”€ ANSWER FEEDBACK â”€â”€ */
.answer-feedback {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  background: #fff; border: 1px solid #e2e8f0; border-radius: 12px; padding: 8px 12px;
  font-size: .88rem; font-weight: bold;
  box-shadow: 0 1px 3px 0 rgba(0,0,0,0.05);
}
.answer-feedback.ok { border-color: #10b981; background: #f0faf4; }
.answer-feedback.no { border-color: #ef4444; background: #fdf3f2; }
.btn-avanti {
  background: var(--primary); color: #fff; border: none;
  padding: 5px 12px; border-radius: 8px; font-size: .8rem;
  cursor: pointer; white-space: nowrap; margin-left: auto;
  transition: background .2s, transform .15s;
}
.btn-avanti:hover { background: var(--primary-dark); }
.btn-teoria {
  background: #fff; color: var(--primary); border: 1.5px solid var(--primary);
  padding: 5px 12px; border-radius: 8px; font-size: .8rem;
  cursor: pointer; white-space: nowrap; transition: background .2s, color .2s;
}
.btn-teoria:hover { background: var(--primary); color: #fff; }
#modal-teoria-body .intro {
  background: var(--primary-light); border-left: 4px solid var(--primary);
  border-radius: 0 6px 6px 0; padding: 12px 14px; margin-bottom: 16px;
  font-size: .9rem; color: var(--primary-dark);
}
#modal-teoria-body .section-title {
  font-size: .8rem; text-transform: uppercase; letter-spacing: .06em;
  color: #4a5568; margin: 18px 0 8px; font-weight: 700;
}
#modal-teoria-body .rules-list { list-style: none; }
#modal-teoria-body .rules-list li {
  padding: 7px 0 7px 24px; border-bottom: 1px solid #e2e8f0;
  font-size: .88rem; position: relative; line-height: 1.5;
}
#modal-teoria-body .rules-list li:last-child { border-bottom: none; }
#modal-teoria-body .rules-list li::before { content: "✓"; position: absolute; left: 0; color: #16a34a; font-weight: 700; }
#modal-teoria-body .numbers-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; margin-top: 10px;
}
#modal-teoria-body .number-card { background: #f0f4f8; border-radius: 8px; padding: 10px 12px; border: 1px solid #e2e8f0; }
#modal-teoria-body .number-card .val { font-size: 1.1rem; font-weight: 700; color: var(--primary); }
#modal-teoria-body .number-card .label { font-size: .78rem; color: #4a5568; margin-top: 2px; }
#modal-teoria-body .warning-box {
  background: #fff7ed; border-left: 4px solid #ff6f00; border-radius: 0 6px 6px 0;
  padding: 10px 14px; margin-top: 14px; font-size: .85rem; color: #7c2d12;
}
#modal-teoria-body .warning-box strong { color: #c0530a; }

/* â”€â”€ BOTTOM BAR â”€â”€ */
.bottom-bar {
  display: flex; align-items: center; gap: 6px;
  background: #fff; border: 1px solid #e2e8f0; border-radius: 12px; padding: 5px 8px; flex-wrap: wrap;
  box-shadow: 0 1px 3px 0 rgba(0,0,0,0.05);
}
.timer-box { min-width: 90px; }
.timer-label { font-size: .68rem; color: #333; }
.timer-value { font-size: 1.3rem; font-weight: bold; color: var(--primary); }
.timer-value.warning { color: #c2410c; }
.score-box { flex: 1; min-width: 80px; }
.score-label { font-size: .68rem; color: #333; }
.score-value { font-size: .9rem; font-weight: bold; color: var(--primary); }
.score-value.negative { color: #ef4444; }
.nav-box { display: flex; gap: 5px; }
.btn-nav {
  width: 44px; height: 44px; border-radius: 50%;
  border: 2px solid #cbd5e1; background: #f1f5f9;
  font-size: 1.2rem; cursor: pointer; color: #475569;
  display: flex; align-items: center; justify-content: center;
  transition: all .2s ease;
}
.btn-nav:hover { background: #e2e8f0; border-color: #94a3b8; }
.btn-nav:disabled { opacity: .3; cursor: default; }
.btn-riepilogo { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 8px; padding: 3px 7px; cursor: pointer; font-size: .68rem; text-align: center; transition: all .2s; }
.btn-riepilogo:hover { background: #e2e8f0; }
.riepilogo-icon { font-size: .72rem; line-height: 1.4; }
.ri-check { color: #047857; }
.riepilogo-label { font-size: .62rem; color: #555; margin-top: 1px; }

/* â”€â”€ RIEPILOGO â”€â”€ */
.riepilogo-header {
  background: #fff; border-radius: 8px; padding: 14px; margin-bottom: 10px;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.riepilogo-header h2 { flex: 1; color: #333; font-size: 1.1rem; }
.riepilogo-btns { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.btn-hub {
  display: inline-flex; align-items: center; padding: 6px 14px; border-radius: 6px;
  border: 1.5px solid #e2e8f0; background: #f8fafc;
  font-size: .76rem; font-weight: 600; color: #445; text-decoration: none;
}
.btn-hub:hover { background: #e2e8f0; border-color: #889; }
.riepilogo-table { display: flex; flex-direction: column; gap: 5px; }
.riepilogo-row {
  display: grid; grid-template-columns: 30px 1fr auto;
  align-items: center; gap: 6px;
  background: #fff; border-radius: 6px; padding: 9px 10px;
  border-left: 4px solid #ccc; cursor: pointer;
}
.riepilogo-row.correct { border-left-color: #10b981; }
.riepilogo-row.wrong   { border-left-color: #ef4444; }
.riepilogo-row.skipped { border-left-color: #f39c12; }
.riepilogo-row:hover   { background: #f8f8f8; }
.riepilogo-num { font-weight: bold; color: #555; font-size: .85rem; }
.riepilogo-q   { font-size: .85rem; color: #333; }
.riepilogo-ans { font-size: .78rem; color: #888; white-space: nowrap; }

/* â”€â”€ ARGOMENTO GRID â”€â”€ */
.argomento-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.arg-card {
  background: #fff; border: 2px solid #e0e0e0; border-radius: 10px;
  padding: 16px; cursor: pointer; transition: border-color .15s, box-shadow .15s;
}
.arg-card:hover { border-color: var(--primary); box-shadow: 0 3px 12px rgba(0,0,0,.1); }
.arg-title { font-size: .88rem; font-weight: 700; color: #222; margin-bottom: 4px; line-height: 1.4; }
.arg-count { font-size: .78rem; color: #888; }

/* â”€â”€ RESULT â”€â”€ */
.result-container { width: 100%; max-width: 600px; margin: auto; padding: 16px; }
.result-box {
  background: #fff; border-radius: 12px; padding: 40px 32px; text-align: center;
  box-shadow: 0 4px 20px rgba(0,0,0,.2);
}
#result-icon  { font-size: 3.5rem; margin-bottom: 10px; }
#result-title { font-size: 1.6rem; margin-bottom: 6px; }
#result-msg   { color: #555; margin-bottom: 18px; font-size: .9rem; }
.stat-row { font-size: .95rem; margin: 5px 0; }
.stat-row span { font-weight: bold; }

/* â”€â”€ SOCIAL â”€â”€ */
.social-share { display: flex; gap: 8px; }
.social-btn { width: 34px; height: 34px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #fff; text-decoration: none; transition: transform .15s, opacity .15s; }
.social-btn svg { width: 17px; height: 17px; }
.social-btn:hover { transform: scale(1.12); opacity: .9; }
.social-wa { background: #25d366; }
.social-fb { background: #1877f2; }
.social-tg { background: #229ed9; }

/* â”€â”€ FOOTER â”€â”€ */
.start-footer { margin-top: 18px; padding-top: 12px; border-top: 1px solid #e8eaf0; text-align: center; font-size: .78rem; color: #64748b; }
.start-footer strong { color: #888; font-weight: 600; }
.visit-chip { margin-left: 14px; font-size: .75rem; color: #99a; }

/* â”€â”€ ADS â”€â”€ */
.ad-top { width: 100%; background: #f8f8f8; min-height: 0; overflow: hidden; padding: 0; display: flex; align-items: center; justify-content: center; border-bottom: 1px solid #e8e8e8; }
.ad-top:not(:has(iframe)), .ad-top:has(ins[data-ad-status="unfilled"]) { display: none; }
.ad-bottom:not(:has(iframe)), .ad-bottom:has(ins[data-ad-status="unfilled"]) { display: none; }
.ad-bottom { width: 100%; background: #f8f8f8; min-height: 90px; display: flex; align-items: center; justify-content: center; border-top: 1px solid #e8e8e8; margin-top: 16px; }
.ad-side { display: none; position: fixed; top: 50%; transform: translateY(-50%); width: 160px; z-index: 50; }
.ad-side-right { right: 8px; }
.ad-side-left  { left: 8px; }
@media (min-width: 1300px) { .ad-side { display: block; } }
@media (max-width: 767px)  { .ad-top { min-height: 0; } .ad-side { display: none !important; } }

/* â”€â”€ MOBILE â”€â”€ */
@media (max-width: 600px) {
  #screen-quiz.active, #screen-riepilogo.active { padding: 4px; }
  .num-btn { font-size: .72rem; padding: 4px 1px; }
  .bottom-bar { gap: 10px; padding: 8px 10px; row-gap: 12px; }
  .timer-value { font-size: 1.1rem; }
  .btn-vf { width: 54px; height: 54px; font-size: 1.3rem; }
}

body:has(#screen-quiz.active) .ad-top,
body:has(#screen-quiz.active) #wa-float,
body:has(#screen-result.active) #wa-float,
body:has(#screen-riepilogo.active) #wa-float { display: none !important; }

/* ── ERROR LIST ── */
.result-errors { margin-top: 20px; max-width: 700px; margin-left: auto; margin-right: auto; }
.errors-title { font-size: 1rem; margin-bottom: 12px; color: #ef4444; }
.error-item { background: #fff; border: 1px solid #e2e8f0; border-radius: 10px; padding: 14px; margin-bottom: 10px; }
.error-q { font-size: .88rem; color: #334155; margin-bottom: 8px; line-height: 1.4; }
.error-answers { display: flex; gap: 16px; font-size: .82rem; }
.error-wrong { color: #ef4444; font-weight: 600; }
.error-correct { color: #047857; font-weight: 600; }

/* ── CHALLENGE ── */
.mode-card-challenge { border: 2px solid var(--primary) !important; background: linear-gradient(135deg, #fff 60%, var(--primary-light)) !important; }
.btn-challenge { background: var(--primary); color: #fff; border: none; border-radius: 8px; padding: 10px 20px; font-size: .95rem; font-weight: 700; cursor: pointer; width: 100%; transition: background .2s; }
.btn-challenge:hover { background: var(--primary-dark); }
.challenge-share-box { margin-top: 16px; padding: 18px; border: 2px solid var(--primary); border-radius: 14px; background: var(--primary-light); text-align: center; }
.challenge-wa-btn {
  display: inline-flex; align-items: center; gap: 8px;
  background: #25d366; color: #fff; border: none; padding: 14px 24px;
  border-radius: 12px; font-size: .95rem; font-weight: 700; cursor: pointer; text-decoration: none;
  box-shadow: 0 4px 12px rgba(37,211,102,.4), 0 2px 4px rgba(0,0,0,.1);
  transition: all .15s;
}
.challenge-wa-btn:hover { background: #1da855; transform: translateY(-1px); box-shadow: 0 6px 16px rgba(37,211,102,.5), 0 3px 6px rgba(0,0,0,.12); }
.challenge-wa-btn svg { width: 28px; height: 28px; fill: #fff; }
.challenge-vs { display: flex; align-items: center; justify-content: center; gap: 20px; margin: 14px 0; }
.challenge-player { text-align: center; }
.challenge-player-label { font-size: .75rem; color: #888; margin-bottom: 4px; }
.challenge-player-score { font-size: 2rem; font-weight: 700; }
.challenge-player-score.win { color: #047857; }
.challenge-player-score.lose { color: #ef4444; }
.challenge-player-score.draw { color: var(--primary); }
.challenge-vs-icon { font-size: 1.2rem; font-weight: 600; color: var(--primary); }
.challenge-result-msg { text-align: center; font-size: 1.1rem; font-weight: 700; padding: 8px 16px; border-radius: 8px; margin-top: 8px; }
.challenge-result-msg.win { background: rgba(39,174,96,.1); color: #047857; }
.challenge-result-msg.lose { background: rgba(231,76,60,.1); color: #ef4444; }
.challenge-result-msg.draw { background: var(--primary-light); color: var(--primary-dark); }
.challenge-rematch { background: #f1f5f9; color: #334155; border: 1.5px solid #e2e8f0; border-radius: 8px; padding: 10px 20px; font-size: .9rem; font-weight: 600; cursor: pointer; width: 100%; }
.challenge-rematch:hover { background: var(--primary-dark); color: #fff; border-color: var(--primary-dark); }

/* â”€â”€ TOP BTNS â”€â”€ */
.top-btns { display: flex; gap: 10px; justify-content: center; margin: 10px 0 4px; }
.btn-matrix { background: #d35400; color: #fff; border: none; border-radius: 6px; padding: 8px 16px; font-size: .85rem; font-weight: 600; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; }
.btn-matrix:hover { background: #ba4a00; }
.btn-manuale { background: #1565c0 !important; color: #fff !important; text-decoration: none !important; }
.btn-manuale:hover { background: #0d47a1 !important; }

/* â”€â”€ MODAL â”€â”€ */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal-box { background: #fff; border-radius: 10px; width: 100%; max-width: 560px; max-height: 88vh; display: flex; flex-direction: column; }
.modal-box-wide { max-width: 720px; }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid #eee; }
.modal-header h3 { color: #1e3a5f; font-size: 1rem; }
.modal-close { background: none; border: none; font-size: 1.2rem; cursor: pointer; color: #999; padding: 0; }
.modal-close:hover { color: #333; }
.modal-body { padding: 16px 18px; overflow-y: auto; flex: 1; }

/* Decoder cards nel modal */
.decoder-card { border-radius: 8px; padding: 12px 14px; margin-bottom: 12px; border-left: 4px solid; }
.decoder-false { background: #fff5f5; border-color: #ef4444; }
.decoder-true  { background: #f0faf4; border-color: #10b981; }
.decoder-header { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.decoder-word   { font-weight: bold; font-size: .95rem; }
.decoder-verdict { font-size: .78rem; font-weight: 700; }
.decoder-false .decoder-verdict { color: #c0392b; }
.decoder-true  .decoder-verdict { color: #059669; }
.decoder-prob { margin-left: auto; font-size: .78rem; font-weight: 700; }
.decoder-false .decoder-prob { color: #ef4444; }
.decoder-true  .decoder-prob { color: #047857; }
.decoder-bar-bg { height: 5px; background: #e0e0e0; border-radius: 3px; margin-bottom: 6px; }
.decoder-bar    { height: 5px; border-radius: 3px; }
.decoder-bar-false { background: #ef4444; }
.decoder-bar-true  { background: #10b981; }
.decoder-desc { font-size: .8rem; color: #555; margin: 0; }

/* â”€â”€ MATRIX HINT â”€â”€ */
.matrix-hint-inline {
  background: #fffbea; color: #78350f;
  border-radius: 5px; padding: 7px 12px;
  font-size: .78rem; line-height: 1.6;
  border: 1px solid #fcd34d; border-left: 4px solid #f59e0b;
}
.matrix-hint-inline .hint-label { font-size: .7rem; color: #b45309; font-weight: bold; letter-spacing: .3px; }
.hint-toggle { cursor: pointer; user-select: none; display: flex; align-items: center; gap: 6px; }
.hint-toggle:hover { color: #92400e; }
.hint-arrow { font-size: .6rem; }
.hint-content { margin-top: 6px; }

/* â”€â”€ KEYWORD HIGHLIGHT â”€â”€ */
.kw-highlight { cursor: pointer; border-radius: 3px; padding: 0 2px; font-weight: bold; }
.kw-false { background: #fde8e8; color: #c0392b; border-bottom: 2px solid #ef4444; }
.kw-true  { background: #e8f8ee; color: #059669; border-bottom: 2px solid #10b981; }
.kw-highlight:hover { opacity: .8; }

/* â”€â”€ KEYWORD TOOLTIP â”€â”€ */
.kw-tooltip {
  position: relative; margin-top: 8px;
  border-radius: 8px; padding: 10px 12px;
  font-size: .8rem; line-height: 1.5; border-left: 4px solid;
}
.kw-tooltip-false { background: #fff5f5; border-color: #ef4444; }
.kw-tooltip-true  { background: #f0faf4; border-color: #10b981; }
.kw-tip-close { float: right; background: none; border: none; cursor: pointer; font-size: .85rem; color: #999; padding: 0; }
.kw-tip-label   { font-weight: bold; font-size: .88rem; color: #222; margin-bottom: 2px; }
.kw-tip-verdict { font-size: .75rem; font-weight: bold; margin-bottom: 5px; }
.kw-tooltip-false .kw-tip-verdict { color: #c0392b; }
.kw-tooltip-true  .kw-tip-verdict { color: #059669; }
.kw-tip-bar-bg  { height: 5px; background: #e0e0e0; border-radius: 3px; margin-bottom: 5px; }
.kw-tip-bar     { height: 5px; border-radius: 3px; }
.kw-tip-bar-false { background: #ef4444; }
.kw-tip-bar-true  { background: #10b981; }
.kw-tip-prob    { font-size: .78rem; font-weight: bold; margin-bottom: 4px; }
.kw-tooltip-false .kw-tip-prob { color: #ef4444; }
.kw-tooltip-true  .kw-tip-prob { color: #047857; }
.kw-tip-desc    { font-size: .75rem; color: #555; }

.donate-link { white-space: nowrap;
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 700; color: #b45309; background: #fff7e6;
  border: 1.5px solid #fbbf24; padding: 9px 20px; border-radius: 999px;
  text-decoration: none; transition: all .2s;
}
.donate-link:hover { background: #fbbf24; color: #fff; border-color: #fbbf24; }
.result-donate { text-align: center; margin-top: 16px; }
.result-donate a {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 700; color: #b45309; background: #fff7e6;
  border: 1.5px solid #fbbf24; padding: 9px 20px; border-radius: 999px;
  text-decoration: none; transition: all .2s;
}
.result-donate a:hover { background: #fbbf24; color: #fff; border-color: #fbbf24; }


/* ── CORIANDOLI PROMOZIONE ──────────────────────────────────────────────── */
.confetti-layer {
  position: fixed; inset: 0; overflow: hidden;
  pointer-events: none; z-index: 3000;
}
.confetti-piece {
  position: absolute; top: -14px;
  width: 8px; height: 14px; border-radius: 2px;
  opacity: .95;
  animation: confettiFall linear forwards;
}
@keyframes confettiFall {
  to { transform: translate3d(var(--drift, 0px), 105vh, 0) rotate(var(--spin, 540deg)); }
}

/* ── INDICATORE PRONTEZZA ESAME ─────────────────────────────────────────── */
.ready-banner {
  flex-basis: 100%; width: 100%;
  border-radius: 10px; padding: 9px 14px;
  font-size: .85rem; line-height: 1.5; text-align: center;
  border: 1px solid transparent;
  opacity: 0; animation: readyIn .35s ease forwards;
}
.ready-banner u { text-underline-offset: 2px; cursor: pointer; }
.ready-ok  { background: #ecfdf5; border-color: #6ee7b7; color: #065f46; }
.ready-mid { background: #fffbeb; border-color: #fcd34d; color: #92400e; }
.ready-low { background: #fef2f2; border-color: #fca5a5; color: #991b1b; }
@keyframes readyIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@media (max-width: 480px) { .ready-banner { grid-column: 1 / -1; } }

/* ── % PERSONALE NELLE CARD ARGOMENTO ───────────────────────────────────── */
.arg-pct {
  display: inline-block; margin-top: 8px;
  font-size: .78rem; font-weight: 700; border-radius: 10px; padding: 2px 8px;
}
.arg-pct.ok  { background: #ecfdf5; color: #059669; }
.arg-pct.mid { background: #fffbeb; color: #b45309; }
.arg-pct.low { background: #fef2f2; color: #dc2626; }

.arg-pct-n { font-weight: 400; font-size: .85em; opacity: .75; }
