/* --------------------------------------------------------------------------
   LOGICA LAB - Premium Modern Educational Web Application
   Target: 14yo high school students (Prima Superiore)
   Style: Neo-cyber didactic glassmorphism, rich gradients, dynamic micro-interactions
   -------------------------------------------------------------------------- */

:root {
    /* Color Palette */
    --bg-main: #0b0f19;
    --bg-secondary: #131a2a;
    --bg-card: rgba(23, 32, 54, 0.75);
    --bg-card-hover: rgba(30, 42, 72, 0.85);
    --border-color: rgba(99, 125, 180, 0.22);
    --border-glow: rgba(99, 102, 241, 0.4);

    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;

    /* Accent & Logic Colors */
    --accent-indigo: #6366f1;
    --accent-violet: #8b5cf6;
    --accent-cyan: #06b6d4;
    --accent-emerald: #10b981;
    --accent-amber: #f59e0b;
    --accent-rose: #f43f5e;

    --true-color: #10b981;
    --true-bg: rgba(16, 185, 129, 0.15);
    --false-color: #f43f5e;
    --false-bg: rgba(244, 63, 94, 0.15);

    /* Gradients */
    --grad-primary: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
    --grad-cyan: linear-gradient(135deg, #06b6d4 0%, #3b82f6 100%);
    --grad-amber: linear-gradient(135deg, #f59e0b 0%, #ef4444 100%);
    --grad-emerald: linear-gradient(135deg, #10b981 0%, #06b6d4 100%);
    --grad-card: linear-gradient(145deg, rgba(25, 36, 61, 0.6) 0%, rgba(15, 23, 42, 0.8) 100%);

    /* Typography */
    --font-sans: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-mono: 'Fira Code', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;

    /* Shadows & Radii */
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 22px;
    --radius-xl: 32px;
    --shadow-soft: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 25px rgba(99, 102, 241, 0.35);
    --shadow-true: 0 0 20px rgba(16, 185, 129, 0.4);
    --shadow-false: 0 0 20px rgba(244, 63, 94, 0.4);

    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* --------------------------------------------------------------------------
   LUMINOUS ACADEMIC LIGHT THEME (Interfaccia Chiara & Didattica per Aula/LIM)
   -------------------------------------------------------------------------- */
body.light-theme {
    --bg-main: #f8fafc;
    --bg-secondary: #f1f5f9;
    --bg-card: #ffffff;
    --bg-card-hover: #ffffff;
    --border-color: #e2e8f0;
    --border-glow: rgba(99, 102, 241, 0.25);

    --text-primary: #0f172a;
    --text-secondary: #334155;
    --text-muted: #64748b;

    --true-color: #059669;
    --true-bg: rgba(16, 185, 129, 0.14);
    --false-color: #e11d48;
    --false-bg: rgba(244, 63, 94, 0.12);

    --grad-card: linear-gradient(180deg, #ffffff 0%, #fbfcfd 100%);
    --shadow-soft: 0 4px 20px -2px rgba(15, 23, 42, 0.06), 0 2px 6px -1px rgba(15, 23, 42, 0.04);
    --shadow-glow: 0 4px 18px rgba(99, 102, 241, 0.18);

    background-color: #f8fafc;
    background-image: 
        radial-gradient(circle at 15% 15%, rgba(99, 102, 241, 0.06) 0%, transparent 40%),
        radial-gradient(circle at 85% 80%, rgba(14, 165, 233, 0.06) 0%, transparent 45%),
        radial-gradient(circle at 50% 50%, rgba(245, 158, 11, 0.04) 0%, transparent 60%);
    color: #0f172a;
}

body.light-theme .app-header {
    background: rgba(255, 255, 255, 0.92);
    border-bottom: 1px solid #e2e8f0;
    box-shadow: 0 2px 12px rgba(15, 23, 42, 0.04);
}

body.light-theme .logo-brand .logo-text h1 {
    color: #0f172a;
}

body.light-theme .logo-brand .logo-text span {
    color: #64748b;
}

body.light-theme .nav-btn {
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    color: #475569;
}

body.light-theme .nav-btn:hover {
    background: #eef2ff;
    color: #4338ca;
    border-color: #c7d2fe;
}

body.light-theme .nav-btn.active {
    background: #4338ca;
    color: #ffffff;
    border-color: #4338ca;
    box-shadow: 0 2px 10px rgba(67, 56, 202, 0.3);
}

body.light-theme .xp-badge {
    background: #fef3c7;
    border: 1px solid #fde68a;
    color: #b45309;
}

body.light-theme .icon-btn {
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    color: #334155;
}

body.light-theme .icon-btn:hover {
    background: #e2e8f0;
}

body.light-theme .logibot-bar {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.05);
}

body.light-theme .logibot-bar::before {
    background: linear-gradient(90deg, #4f46e5, #0284c7, #d97706);
}

body.light-theme .logibot-speech {
    color: #1e293b;
}

body.light-theme .hero-title {
    color: #0f172a;
}

body.light-theme .pillar-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 20px rgba(15, 23, 42, 0.05);
}

body.light-theme .pillar-card:hover {
    box-shadow: 0 10px 30px rgba(99, 102, 241, 0.12);
}

body.light-theme .pillar-title {
    color: #0f172a;
}

body.light-theme .pillar-icon-box {
    background: #eef2ff;
    border-color: #c7d2fe;
}

body.light-theme .pillar-card.sets .pillar-icon-box {
    background: #e0f2fe;
    border-color: #bae6fd;
}

body.light-theme .bridge-box {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
}

body.light-theme .bridge-title {
    color: #0369a1;
}

body.light-theme .bridge-item {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.03);
}

body.light-theme .bridge-item:hover {
    background: #f8fafc;
    border-color: #818cf8;
}

body.light-theme .bridge-equation .log-side {
    color: #4338ca;
}

body.light-theme .bridge-equation .set-side {
    color: #0284c7;
}

body.light-theme .paradox-container {
    background: linear-gradient(135deg, rgba(244, 63, 94, 0.04) 0%, rgba(99, 102, 241, 0.04) 100%);
    border: 1px solid #fecdd3;
    box-shadow: 0 8px 30px rgba(244, 63, 94, 0.08);
}

body.light-theme .paradox-sentence-box {
    background: #ffffff;
    border: 2px dashed #fda4af;
    box-shadow: 0 4px 20px rgba(244, 63, 94, 0.12);
}

body.light-theme .paradox-sentence {
    color: #0f172a;
}

body.light-theme .paradox-result-box.glitch-active {
    background: #ffffff;
    border: 1px solid #f43f5e;
    box-shadow: 0 8px 30px rgba(244, 63, 94, 0.15);
}

body.light-theme .paradox-moral {
    background: #eef2ff;
    border-left-color: #4f46e5;
    color: #1e1b4b;
}

body.light-theme .section-title-group h2 {
    color: #0f172a;
}

body.light-theme .badge-module {
    background: #eef2ff;
    border: 1px solid #c7d2fe;
    color: #4338ca;
}

body.light-theme .prop-game-container {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 20px rgba(15, 23, 42, 0.05);
}

body.light-theme .card-flash {
    background: #ffffff;
    border: 2px solid #e2e8f0;
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.06);
}

body.light-theme .card-flash-text {
    color: #0f172a;
}

body.light-theme .conn-tab-btn {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.03);
}

body.light-theme .conn-tab-btn:hover {
    border-color: #818cf8;
    background: #f8fafc;
}

body.light-theme .conn-tab-btn.active {
    background: #4338ca;
    border-color: #4338ca;
    box-shadow: 0 4px 14px rgba(67, 56, 202, 0.35);
}

body.light-theme .conn-tab-btn.active .sym,
body.light-theme .conn-tab-btn.active .name {
    color: #ffffff;
}

body.light-theme .conn-detail-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    box-shadow: 0 6px 24px rgba(15, 23, 42, 0.06);
}

body.light-theme .conn-title h3 {
    color: #0f172a;
}

body.light-theme .pill-tag {
    background: #eef2ff;
    border-color: #c7d2fe;
    color: #4338ca;
}

body.light-theme .rep-mode-nav {
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
}

body.light-theme .rep-mode-btn {
    color: #475569;
}

body.light-theme .rep-mode-btn:hover {
    color: #0f172a;
}

body.light-theme .rep-mode-btn.active {
    background: #ffffff;
    color: #4338ca;
    border: 1px solid #c7d2fe;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

body.light-theme .truth-table-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.05);
}

body.light-theme .truth-table th {
    background: #f8fafc;
    color: #334155;
    border-bottom: 2px solid #e2e8f0;
}

body.light-theme .truth-table td {
    border-bottom: 1px solid #f1f5f9;
    color: #1e293b;
}

body.light-theme .truth-table tr.active-row td {
    background: #fef3c7 !important;
    color: #78350f;
}

body.light-theme .interactive-test-pad {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
}

body.light-theme .pad-title {
    color: #0284c7;
}

body.light-theme .var-toggle-item {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.03);
}

body.light-theme .var-name {
    color: #1e293b;
}

body.light-theme .live-eval-output {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

body.light-theme .eval-formula {
    color: #0f172a;
}

body.light-theme .venn-svg-box {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
}

body.light-theme .circuit-canvas-box {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
}

body.light-theme .rep-real-view {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.04);
}

body.light-theme .real-example-box {
    color: #1e293b;
}

body.light-theme .real-example-box blockquote {
    border-left-color: #d97706;
    color: #92400e;
    background: #fffbeb;
    padding: 0.85rem 1.25rem;
    border-radius: 0 8px 8px 0;
}

body.light-theme .calc-laboratory {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    box-shadow: 0 6px 24px rgba(15, 23, 42, 0.06);
}

body.light-theme .preset-pill-btn {
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    color: #475569;
}

body.light-theme .preset-pill-btn:hover {
    background: #eef2ff;
    color: #4338ca;
    border-color: #c7d2fe;
}

body.light-theme .formula-text-input {
    background: #ffffff;
    border: 2px solid #cbd5e1;
    color: #0f172a;
}

body.light-theme .formula-text-input:focus {
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

body.light-theme .virtual-keyboard {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
}

body.light-theme .key-btn {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    color: #0f172a;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

body.light-theme .key-btn:hover {
    background: #4338ca;
    color: #ffffff;
    border-color: #4338ca;
}

body.light-theme .key-btn.op-key {
    color: #0284c7;
    font-weight: 800;
}

body.light-theme .key-btn.op-key:hover {
    color: #ffffff;
}

body.light-theme .generated-table-wrapper {
    background: #ffffff;
    border: 1px solid #e2e8f0;
}

body.light-theme .case-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 20px rgba(15, 23, 42, 0.05);
}

body.light-theme .case-title {
    color: #0f172a;
}

body.light-theme .premises-box {
    background: #f8fafc;
    border-left-color: #4f46e5;
    color: #1e293b;
    border-top: 1px solid #e2e8f0;
    border-right: 1px solid #e2e8f0;
    border-bottom: 1px solid #e2e8f0;
}

body.light-theme .conclusion-line {
    color: #b45309;
    border-top-color: #e2e8f0;
}

body.light-theme .case-question {
    color: #0369a1;
}

body.light-theme .island-workspace {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 20px rgba(15, 23, 42, 0.05);
}

body.light-theme .island-canvas {
    background: #f8fafc;
    border: 2px dashed #c7d2fe;
}

body.light-theme .shape-entity {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

body.light-theme .btn-add-shape {
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    color: #334155;
}

body.light-theme .btn-add-shape:hover {
    background: #4338ca;
    color: #ffffff;
    border-color: #4338ca;
}

body.light-theme .challenge-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
}

body.light-theme .challenge-card.active {
    border-color: #0284c7;
    box-shadow: 0 0 16px rgba(2, 132, 199, 0.15);
}

body.light-theme .challenge-formula {
    color: #0369a1;
}

body.light-theme .quiz-final-container {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    box-shadow: 0 6px 24px rgba(15, 23, 42, 0.06);
}

body.light-theme .certificate-card {
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
    border: 3px solid #d97706;
    box-shadow: 0 10px 40px rgba(217, 119, 6, 0.18);
}

body.light-theme .cert-title {
    color: #92400e;
}

body.light-theme .cert-student-name {
    color: #1e293b;
    border-bottom-color: #d97706;
}

body.light-theme .app-footer {
    background: #ffffff;
    border-top: 1px solid #e2e8f0;
    color: #64748b;
}

/* --------------------------------------------------------------------------
   Reset & Base
   -------------------------------------------------------------------------- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-sans);
    background-color: var(--bg-main);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
    background-image: 
        radial-gradient(circle at 15% 15%, rgba(99, 102, 241, 0.12) 0%, transparent 40%),
        radial-gradient(circle at 85% 80%, rgba(168, 85, 247, 0.12) 0%, transparent 45%),
        radial-gradient(circle at 50% 50%, rgba(6, 182, 212, 0.06) 0%, transparent 60%);
    background-attachment: fixed;
}

/* --------------------------------------------------------------------------
   Layout: App Header & Nav
   -------------------------------------------------------------------------- */
.app-header {
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    background: rgba(11, 15, 25, 0.82);
    border-bottom: 1px solid var(--border-color);
    padding: 0.85rem 1.5rem;
    transition: var(--transition);
}

body.light-theme .app-header {
    background: rgba(255, 255, 255, 0.88);
}

.header-container {
    max-width: 1380px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.logo-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: var(--text-primary);
}

.logo-icon {
    width: 44px;
    height: 44px;
    background: var(--grad-primary);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    box-shadow: var(--shadow-glow);
    animation: pulseIcon 3s ease-in-out infinite alternate;
}

@keyframes pulseIcon {
    0% { transform: scale(1); filter: drop-shadow(0 0 4px var(--accent-indigo)); }
    100% { transform: scale(1.05); filter: drop-shadow(0 0 12px var(--accent-violet)); }
}

.logo-text h1 {
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    background: linear-gradient(90deg, #60a5fa, #c084fc, #38bdf8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.logo-text span {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-secondary);
    font-weight: 600;
    display: block;
}

/* Nav Menu Tabs */
.nav-scroll {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    overflow-x: auto;
    padding: 0.2rem 0;
    scrollbar-width: none;
}

.nav-scroll::-webkit-scrollbar {
    display: none;
}

.nav-btn {
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-secondary);
    padding: 0.5rem 0.9rem;
    border-radius: var(--radius-md);
    font-size: 0.88rem;
    font-weight: 600;
    font-family: var(--font-sans);
    cursor: pointer;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 0.45rem;
    transition: var(--transition);
}

.nav-btn:hover {
    color: var(--text-primary);
    background: rgba(99, 102, 241, 0.1);
    border-color: rgba(99, 102, 241, 0.25);
}

.nav-btn.active {
    background: var(--grad-primary);
    color: #ffffff;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
    border-color: transparent;
}

/* Header Controls & XP */
.header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.xp-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(245, 158, 11, 0.15);
    border: 1px solid rgba(245, 158, 11, 0.35);
    padding: 0.4rem 0.85rem;
    border-radius: 999px;
    font-size: 0.88rem;
    font-weight: 700;
    color: #fbbf24;
}

.icon-btn {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    width: 38px;
    height: 38px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.1rem;
    transition: var(--transition);
}

.icon-btn:hover {
    border-color: var(--accent-indigo);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.2);
}

/* --------------------------------------------------------------------------
   Main Container & Floating Tutor
   -------------------------------------------------------------------------- */
.main-wrapper {
    max-width: 1380px;
    margin: 0 auto;
    padding: 2rem 1.5rem 6rem;
    display: flex;
    flex-direction: column;
    gap: 3.5rem;
}

/* LogiBot Floating Buddy */
.logibot-bar {
    background: var(--grad-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.25rem 1.5rem;
    backdrop-filter: blur(12px);
    box-shadow: var(--shadow-soft);
    display: flex;
    align-items: center;
    gap: 1.25rem;
    position: relative;
    overflow: hidden;
}

.logibot-bar::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 6px;
    background: var(--grad-primary);
}

.logibot-avatar {
    width: 60px;
    height: 60px;
    flex-shrink: 0;
    border-radius: 50%;
    background: var(--grad-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    box-shadow: var(--shadow-glow);
    animation: floatBot 4s ease-in-out infinite;
    cursor: pointer;
}

@keyframes floatBot {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

.logibot-content {
    flex: 1;
}

.logibot-tag {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--accent-cyan);
    letter-spacing: 0.08em;
    margin-bottom: 0.2rem;
}

.logibot-speech {
    font-size: 1rem;
    color: var(--text-primary);
    line-height: 1.5;
}

.logibot-speech strong {
    color: #60a5fa;
}

/* --------------------------------------------------------------------------
   Hero Section: Intro & The Two Pillars
   -------------------------------------------------------------------------- */
.hero-section {
    text-align: center;
    padding: 2.5rem 1rem;
    background: radial-gradient(circle at 50% 30%, rgba(99, 102, 241, 0.15) 0%, transparent 70%);
    border-radius: var(--radius-xl);
    border: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
}

.hero-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(99, 102, 241, 0.15);
    border: 1px solid rgba(99, 102, 241, 0.35);
    padding: 0.4rem 1rem;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 700;
    color: #a5b4fc;
    margin-bottom: 1.25rem;
}

.hero-title {
    font-size: clamp(2.2rem, 5vw, 3.8rem);
    font-weight: 900;
    line-height: 1.15;
    margin-bottom: 1rem;
    letter-spacing: -0.03em;
}

.hero-title .highlight {
    background: linear-gradient(135deg, #38bdf8 0%, #818cf8 50%, #c084fc 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-subtitle {
    font-size: clamp(1.05rem, 2vw, 1.25rem);
    color: var(--text-secondary);
    max-width: 800px;
    margin: 0 auto 2.5rem;
}

/* The Two Pillars Interactive Visualizer */
.pillars-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
    text-align: left;
}

.pillar-card {
    background: var(--grad-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 2rem;
    backdrop-filter: blur(12px);
    transition: var(--transition);
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.pillar-card:hover {
    transform: translateY(-4px);
    border-color: var(--accent-indigo);
    box-shadow: 0 15px 35px -10px rgba(99, 102, 241, 0.25);
}

.pillar-header {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.pillar-icon-box {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-md);
    background: rgba(99, 102, 241, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    border: 1px solid var(--border-glow);
}

.pillar-card.sets .pillar-icon-box {
    background: rgba(6, 182, 212, 0.2);
    border-color: rgba(6, 182, 212, 0.4);
}

.pillar-title {
    font-size: 1.35rem;
    font-weight: 800;
}

.pillar-desc {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* Isomorphism Table Modal/Box */
.bridge-box {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-top: 2rem;
    text-align: left;
}

.bridge-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--accent-cyan);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.bridge-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
}

.bridge-item {
    background: rgba(30, 41, 59, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: var(--radius-md);
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    transition: var(--transition);
}

.bridge-item:hover {
    border-color: var(--accent-indigo);
    background: rgba(30, 41, 59, 0.9);
}

.bridge-equation {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-family: var(--font-mono);
    font-size: 0.95rem;
    font-weight: 700;
}

.bridge-equation .log-side {
    color: #818cf8;
}

.bridge-equation .equal-arrow {
    color: var(--accent-amber);
    font-size: 1.1rem;
}

.bridge-equation .set-side {
    color: #38bdf8;
}

.bridge-exp {
    font-size: 0.82rem;
    color: var(--text-muted);
}

/* --------------------------------------------------------------------------
   Module: Paradosso del Mentitore
   -------------------------------------------------------------------------- */
.paradox-container {
    background: linear-gradient(135deg, rgba(244, 63, 94, 0.08) 0%, rgba(139, 92, 246, 0.08) 100%);
    border: 1px solid rgba(244, 63, 94, 0.3);
    border-radius: var(--radius-xl);
    padding: 2.5rem 2rem;
    box-shadow: 0 10px 40px -10px rgba(244, 63, 94, 0.15);
    text-align: center;
    position: relative;
}

.paradox-badge {
    background: rgba(244, 63, 94, 0.2);
    color: #fda4af;
    border: 1px solid rgba(244, 63, 94, 0.4);
    padding: 0.35rem 0.9rem;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    display: inline-block;
    margin-bottom: 1rem;
}

.paradox-sentence-box {
    background: rgba(15, 23, 42, 0.9);
    border: 2px dashed rgba(244, 63, 94, 0.5);
    border-radius: var(--radius-lg);
    padding: 2rem 1.5rem;
    margin: 1.5rem auto;
    max-width: 650px;
    box-shadow: 0 0 30px rgba(244, 63, 94, 0.2);
    transition: var(--transition);
}

.paradox-sentence {
    font-size: clamp(1.4rem, 3.5vw, 2.2rem);
    font-weight: 900;
    color: #fff;
    letter-spacing: 0.02em;
    font-family: var(--font-sans);
}

.paradox-buttons {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

.btn-choice {
    font-family: var(--font-sans);
    font-size: 1.1rem;
    font-weight: 800;
    padding: 0.9rem 2.2rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    border: none;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.6rem;
    box-shadow: var(--shadow-soft);
}

.btn-true {
    background: var(--grad-emerald);
    color: #fff;
}

.btn-true:hover {
    transform: translateY(-3px) scale(1.03);
    box-shadow: var(--shadow-true);
}

.btn-false {
    background: var(--grad-amber);
    color: #fff;
}

.btn-false:hover {
    transform: translateY(-3px) scale(1.03);
    box-shadow: var(--shadow-false);
}

.paradox-result-box {
    margin-top: 1.75rem;
    max-width: 750px;
    margin-left: auto;
    margin-right: auto;
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    display: none;
    animation: fadeIn 0.4s ease forwards;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.paradox-result-box.glitch-active {
    display: block;
    background: rgba(15, 23, 42, 0.95);
    border: 1px solid #f43f5e;
    box-shadow: 0 0 35px rgba(244, 63, 94, 0.35);
}

.glitch-title {
    font-size: 1.4rem;
    font-weight: 800;
    color: #f43f5e;
    margin-bottom: 0.5rem;
}

.paradox-moral {
    margin-top: 2rem;
    padding: 1.25rem;
    background: rgba(99, 102, 241, 0.12);
    border-radius: var(--radius-md);
    border-left: 4px solid var(--accent-indigo);
    font-size: 0.95rem;
    text-align: left;
    color: var(--text-primary);
}

/* --------------------------------------------------------------------------
   Module: Sezioni Didattiche Standard (Cards & Containers)
   -------------------------------------------------------------------------- */
.module-section {
    display: flex;
    flex-direction: column;
    gap: 1.75rem;
    scroll-margin-top: 80px;
}

.section-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1rem;
    flex-wrap: wrap;
}

.section-title-group h2 {
    font-size: 1.85rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.section-title-group p {
    color: var(--text-secondary);
    font-size: 1.05rem;
    margin-top: 0.25rem;
}

.badge-module {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    padding: 0.3rem 0.75rem;
    border-radius: 999px;
    background: rgba(99, 102, 241, 0.15);
    border: 1px solid rgba(99, 102, 241, 0.3);
    color: #a5b4fc;
    font-weight: 700;
}

/* --------------------------------------------------------------------------
   Interactive Game: "Proposizione o No?"
   -------------------------------------------------------------------------- */
.prop-game-container {
    background: var(--grad-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 2.25rem 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.game-score-row {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    font-weight: 700;
    color: var(--text-secondary);
}

.card-flash {
    width: 100%;
    max-width: 680px;
    min-height: 180px;
    background: rgba(15, 23, 42, 0.9);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-soft);
    transition: var(--transition);
}

.card-flash.shake {
    animation: shake 0.5s ease-in-out;
}

.card-flash.pop {
    animation: popSuccess 0.4s ease-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-8px); }
    40%, 80% { transform: translateX(8px); }
}

@keyframes popSuccess {
    0% { transform: scale(0.97); }
    50% { transform: scale(1.03); }
    100% { transform: scale(1); }
}

.card-flash-text {
    font-size: 1.45rem;
    font-weight: 700;
    line-height: 1.4;
    color: var(--text-primary);
}

.card-flash-sub {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
}

.game-controls {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    justify-content: center;
}

.btn-game {
    font-family: var(--font-sans);
    font-size: 1.05rem;
    font-weight: 700;
    padding: 0.85rem 1.8rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    border: 1px solid transparent;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-game-yes {
    background: rgba(16, 185, 129, 0.2);
    border-color: rgba(16, 185, 129, 0.5);
    color: #34d399;
}

.btn-game-yes:hover {
    background: var(--true-color);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: var(--shadow-true);
}

.btn-game-no {
    background: rgba(244, 63, 94, 0.2);
    border-color: rgba(244, 63, 94, 0.5);
    color: #fb7185;
}

.btn-game-no:hover {
    background: var(--false-color);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: var(--shadow-false);
}

.feedback-msg {
    margin-top: 1.5rem;
    padding: 1rem 1.25rem;
    border-radius: var(--radius-md);
    max-width: 680px;
    width: 100%;
    font-size: 0.95rem;
    display: none;
}

.feedback-msg.show-correct {
    display: block;
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.4);
    color: #a7f3d0;
}

.feedback-msg.show-wrong {
    display: block;
    background: rgba(244, 63, 94, 0.15);
    border: 1px solid rgba(244, 63, 94, 0.4);
    color: #fecdd3;
}

/* --------------------------------------------------------------------------
   Module: I Connettivi Logici (Tutte le 4 Rappresentazioni!)
   -------------------------------------------------------------------------- */
.connectives-showcase {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Connettivi Selector Tabs */
.conn-tabs-nav {
    display: flex;
    gap: 0.6rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
    scrollbar-width: none;
}

.conn-tab-btn {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 0.75rem 1.25rem;
    border-radius: var(--radius-md);
    font-family: var(--font-sans);
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    transition: var(--transition);
}

.conn-tab-btn .sym {
    font-family: var(--font-mono);
    font-size: 1.25rem;
    color: var(--accent-indigo);
}

.conn-tab-btn:hover {
    color: var(--text-primary);
    border-color: var(--accent-indigo);
}

.conn-tab-btn.active {
    background: var(--grad-primary);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 4px 18px rgba(99, 102, 241, 0.4);
}

.conn-tab-btn.active .sym {
    color: #fff;
}

/* Connective Active View Container */
.conn-detail-card {
    background: var(--grad-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 2.25rem;
    backdrop-filter: blur(12px);
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.conn-hero-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1.5rem;
}

.conn-title-left {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.conn-big-sym {
    width: 65px;
    height: 65px;
    border-radius: var(--radius-lg);
    background: var(--grad-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-mono);
    font-size: 2.2rem;
    font-weight: 700;
    color: #fff;
    box-shadow: var(--shadow-glow);
}

.conn-names h3 {
    font-size: 1.6rem;
    font-weight: 800;
}

.conn-names p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.conn-meta-tags {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.pill-tag {
    background: rgba(99, 102, 241, 0.15);
    border: 1px solid rgba(99, 102, 241, 0.3);
    color: #c7d2fe;
    font-size: 0.8rem;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    font-weight: 600;
}

/* Sub-Tabs: 4 Rappresentazioni */
.rep-mode-nav {
    display: flex;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.3rem;
    gap: 0.3rem;
    align-self: flex-start;
    flex-wrap: wrap;
}

.rep-mode-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    font-family: var(--font-sans);
    font-size: 0.88rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    transition: var(--transition);
}

.rep-mode-btn:hover {
    color: var(--text-primary);
}

.rep-mode-btn.active {
    background: rgba(99, 102, 241, 0.3);
    color: #fff;
    border: 1px solid var(--border-glow);
}

/* Rappresentazione 1: Tavola di Verità Dinamica */
.rep-truth-table-view {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    align-items: center;
}

@media (max-width: 900px) {
    .rep-truth-table-view {
        grid-template-columns: 1fr;
    }
}

.truth-table-card {
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-soft);
}

.truth-table {
    width: 100%;
    border-collapse: collapse;
    font-family: var(--font-mono);
    text-align: center;
}

.truth-table th {
    background: rgba(30, 41, 59, 0.9);
    padding: 0.9rem 1rem;
    font-size: 0.95rem;
    color: #e2e8f0;
    border-bottom: 2px solid var(--border-color);
    font-weight: 700;
}

.truth-table td {
    padding: 0.85rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 1rem;
    font-weight: 600;
    transition: var(--transition);
}

.truth-table tr.active-row td {
    background: rgba(99, 102, 241, 0.25) !important;
    font-weight: 800;
}

.truth-val {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    font-weight: 800;
}

.truth-val.val-v {
    background: var(--true-bg);
    color: var(--true-color);
    border: 1px solid rgba(16, 185, 129, 0.4);
}

.truth-val.val-f {
    background: var(--false-bg);
    color: var(--false-color);
    border: 1px solid rgba(244, 63, 94, 0.4);
}

/* Interactive Testing Pad */
.interactive-test-pad {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.75rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.pad-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--accent-cyan);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.toggle-vars-row {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.var-toggle-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: rgba(30, 41, 59, 0.7);
    padding: 0.6rem 1rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.var-name {
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 1.1rem;
    color: #93c5fd;
}

.switch-toggle-btn {
    padding: 0.35rem 0.9rem;
    border-radius: var(--radius-sm);
    font-family: var(--font-mono);
    font-weight: 800;
    font-size: 0.9rem;
    cursor: pointer;
    border: 1px solid transparent;
    transition: var(--transition);
}

.switch-toggle-btn.is-true {
    background: var(--true-color);
    color: #fff;
    box-shadow: var(--shadow-true);
}

.switch-toggle-btn.is-false {
    background: var(--false-color);
    color: #fff;
    box-shadow: var(--shadow-false);
}

.live-eval-output {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(15, 23, 42, 0.9);
    padding: 1rem 1.25rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.eval-formula {
    font-family: var(--font-mono);
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
}

.eval-result-badge {
    font-family: var(--font-mono);
    font-size: 1.3rem;
    font-weight: 900;
    padding: 0.4rem 1.2rem;
    border-radius: var(--radius-sm);
}

/* Rappresentazione 2: Diagramma di Eulero-Venn (Insiemi) */
.rep-venn-view {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    align-items: center;
}

@media (max-width: 900px) {
    .rep-venn-view {
        grid-template-columns: 1fr;
    }
}

.venn-svg-box {
    background: rgba(15, 23, 42, 0.9);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 280px;
}

.venn-svg-box svg {
    max-width: 100%;
    height: auto;
}

.venn-info-box {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.venn-info-box h4 {
    font-size: 1.2rem;
    color: var(--accent-cyan);
    font-weight: 800;
}

/* Rappresentazione 3: Circuito Elettrico & Interruttori */
.rep-circuit-view {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    align-items: center;
}

@media (max-width: 900px) {
    .rep-circuit-view {
        grid-template-columns: 1fr;
    }
}

.circuit-canvas-box {
    background: rgba(15, 23, 42, 0.95);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 280px;
    position: relative;
}

.circuit-bulb-status {
    position: absolute;
    top: 1rem;
    right: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    font-weight: 700;
}

.circuit-bulb-indicator {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #64748b;
    transition: var(--transition);
}

.circuit-bulb-indicator.on {
    background: #fbbf24;
    box-shadow: 0 0 16px #f59e0b;
}

/* Rappresentazione 4: Esempio Reale & Promessa */
.rep-real-view {
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 2rem;
    line-height: 1.7;
}

.real-example-box {
    font-size: 1.1rem;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
}

.real-example-box blockquote {
    border-left: 4px solid var(--accent-amber);
    padding-left: 1.25rem;
    margin: 1rem 0;
    font-style: italic;
    color: #fef08a;
}

/* --------------------------------------------------------------------------
   Module: Proposizioni Composte & Laboratorio Tavole
   -------------------------------------------------------------------------- */
.calc-laboratory {
    background: var(--grad-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 2.25rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.preset-pills-row {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
    align-items: center;
}

.preset-pill-btn {
    background: rgba(30, 41, 59, 0.7);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 0.4rem 0.9rem;
    border-radius: var(--radius-md);
    font-family: var(--font-mono);
    font-size: 0.85rem;
    cursor: pointer;
    transition: var(--transition);
}

.preset-pill-btn:hover {
    color: #fff;
    border-color: var(--accent-indigo);
    background: rgba(99, 102, 241, 0.2);
}

.custom-formula-input-box {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.input-with-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.formula-text-input {
    flex: 1;
    min-width: 260px;
    background: rgba(15, 23, 42, 0.9);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.85rem 1.25rem;
    font-family: var(--font-mono);
    font-size: 1.15rem;
    color: #fff;
    outline: none;
    transition: var(--transition);
}

.formula-text-input:focus {
    border-color: var(--accent-indigo);
    box-shadow: 0 0 15px rgba(99, 102, 241, 0.3);
}

.btn-calc {
    background: var(--grad-primary);
    color: #fff;
    border: none;
    padding: 0.85rem 1.8rem;
    border-radius: var(--radius-md);
    font-family: var(--font-sans);
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-calc:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
}

/* Virtual Logic Keyboard */
.virtual-keyboard {
    display: flex;
    gap: 0.45rem;
    flex-wrap: wrap;
    background: rgba(15, 23, 42, 0.6);
    padding: 0.6rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    align-self: flex-start;
}

.key-btn {
    background: rgba(30, 41, 59, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    font-family: var(--font-mono);
    font-size: 1.05rem;
    font-weight: 700;
    padding: 0.4rem 0.85rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
}

.key-btn:hover {
    background: var(--accent-indigo);
    transform: translateY(-2px);
}

.key-btn.op-key {
    color: #38bdf8;
}

/* Generated Truth Table Container */
.generated-table-wrapper {
    overflow-x: auto;
    background: rgba(15, 23, 42, 0.9);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
    margin-top: 1rem;
}

.verdict-banner {
    padding: 1.25rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    border-radius: var(--radius-md);
    font-weight: 800;
    font-size: 1.15rem;
    margin-bottom: 1rem;
}

.verdict-banner.tautologia {
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.4);
    color: #34d399;
}

.verdict-banner.contraddizione {
    background: rgba(244, 63, 94, 0.15);
    border: 1px solid rgba(244, 63, 94, 0.4);
    color: #fb7185;
}

.verdict-banner.contingenza {
    background: rgba(245, 158, 11, 0.15);
    border: 1px solid rgba(245, 158, 11, 0.4);
    color: #fbbf24;
}

/* --------------------------------------------------------------------------
   Module: Forme di Ragionamento & Tribunale delle Fallacie
   -------------------------------------------------------------------------- */
.reasoning-arena {
    display: flex;
    flex-direction: column;
    gap: 1.75rem;
}

.case-card {
    background: var(--grad-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 2.25rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    position: relative;
    overflow: hidden;
}

.case-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.case-title {
    font-size: 1.35rem;
    font-weight: 800;
    color: #f8fafc;
}

.premises-box {
    background: rgba(15, 23, 42, 0.7);
    border-left: 4px solid var(--accent-indigo);
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    padding: 1.25rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    font-size: 1.05rem;
}

.premise-line {
    display: flex;
    gap: 0.5rem;
    color: var(--text-primary);
}

.conclusion-line {
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px dashed var(--border-color);
    color: #fef08a;
    font-weight: 700;
}

.case-question {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--accent-cyan);
}

.case-actions {
    display: flex;
    gap: 1.25rem;
    flex-wrap: wrap;
}

.btn-verdict-valid {
    background: rgba(16, 185, 129, 0.2);
    border: 1px solid rgba(16, 185, 129, 0.5);
    color: #34d399;
    padding: 0.85rem 1.8rem;
    border-radius: var(--radius-md);
    font-family: var(--font-sans);
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition);
}

.btn-verdict-valid:hover {
    background: var(--true-color);
    color: #fff;
    box-shadow: var(--shadow-true);
}

.btn-verdict-fallacy {
    background: rgba(244, 63, 94, 0.2);
    border: 1px solid rgba(244, 63, 94, 0.5);
    color: #fb7185;
    padding: 0.85rem 1.8rem;
    border-radius: var(--radius-md);
    font-family: var(--font-sans);
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition);
}

.btn-verdict-fallacy:hover {
    background: var(--false-color);
    color: #fff;
    box-shadow: var(--shadow-false);
}

.case-explanation-box {
    display: none;
    padding: 1.25rem 1.5rem;
    border-radius: var(--radius-md);
    animation: fadeIn 0.3s ease-out forwards;
}

.case-explanation-box.show {
    display: block;
}

/* --------------------------------------------------------------------------
   Module: I Quantificatori & L'Isola delle Figure
   -------------------------------------------------------------------------- */
.quant-arena {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.island-workspace {
    background: var(--grad-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 2.25rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

@media (max-width: 950px) {
    .island-workspace {
        grid-template-columns: 1fr;
    }
}

.island-canvas {
    background: rgba(15, 23, 42, 0.95);
    border: 2px dashed rgba(99, 102, 241, 0.35);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    min-height: 320px;
    display: flex;
    flex-direction: column;
}

.island-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.shapes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(75px, 1fr));
    gap: 1rem;
    flex: 1;
    align-content: center;
    justify-items: center;
    padding: 1rem 0;
}

.shape-entity {
    width: 65px;
    height: 65px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    cursor: pointer;
    background: rgba(30, 41, 59, 0.7);
    border: 2px solid transparent;
    transition: var(--transition);
    user-select: none;
}

.shape-entity:hover {
    transform: scale(1.1);
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.2);
}

.shape-entity.highlight-counter {
    animation: counterGlitch 1s infinite alternate;
    border-color: #f43f5e !important;
}

@keyframes counterGlitch {
    0% { transform: scale(1); box-shadow: 0 0 10px #f43f5e; }
    100% { transform: scale(1.15); box-shadow: 0 0 25px #f43f5e; }
}

.shape-svg-icon {
    width: 34px;
    height: 34px;
}

.shape-label {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    margin-top: 2px;
}

.island-palette {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
    flex-wrap: wrap;
    justify-content: center;
}

.btn-add-shape {
    background: rgba(30, 41, 59, 0.8);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.4rem 0.85rem;
    border-radius: var(--radius-md);
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
}

.btn-add-shape:hover {
    background: var(--accent-indigo);
    color: #fff;
}

/* Challenges List */
.challenges-panel {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.challenge-card {
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    transition: var(--transition);
}

.challenge-card.active {
    border-color: var(--accent-cyan);
    box-shadow: 0 0 20px rgba(6, 182, 212, 0.2);
}

.challenge-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.challenge-formula {
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 1.05rem;
    color: #67e8f9;
}

.challenge-status {
    font-family: var(--font-mono);
    font-size: 0.95rem;
    font-weight: 800;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-sm);
}

.challenge-exp {
    font-size: 0.88rem;
    color: var(--text-secondary);
}

/* --------------------------------------------------------------------------
   Module: Gran Finale & Certificato
   -------------------------------------------------------------------------- */
.quiz-final-container {
    background: var(--grad-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 2.5rem;
    text-align: center;
}

.certificate-card {
    display: none;
    background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 100%);
    border: 3px solid #fbbf24;
    border-radius: var(--radius-xl);
    padding: 3rem 2rem;
    max-width: 750px;
    margin: 2rem auto;
    position: relative;
    box-shadow: 0 0 50px rgba(251, 191, 36, 0.25);
    text-align: center;
}

.cert-seal {
    width: 80px;
    height: 80px;
    margin: 0 auto 1.5rem;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    box-shadow: 0 0 30px rgba(245, 158, 11, 0.5);
}

.cert-title {
    font-size: 2.2rem;
    font-weight: 900;
    color: #fbbf24;
    letter-spacing: -0.02em;
    margin-bottom: 0.5rem;
}

.cert-student-name {
    font-size: 1.8rem;
    font-weight: 800;
    color: #ffffff;
    border-bottom: 2px dashed #fbbf24;
    display: inline-block;
    padding: 0.25rem 2rem;
    margin: 1rem 0;
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
.app-footer {
    border-top: 1px solid var(--border-color);
    padding: 2.5rem 1.5rem;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
    background: rgba(11, 15, 25, 0.9);
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-top: 0.75rem;
}

.footer-links a {
    color: var(--accent-indigo);
    text-decoration: none;
}

.footer-links a:hover {
    text-decoration: underline;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .header-container {
        flex-direction: column;
        align-items: flex-start;
    }
    .nav-scroll {
        width: 100%;
    }
    .header-actions {
        width: 100%;
        justify-content: space-between;
    }
    .conn-detail-card {
        padding: 1.25rem;
    }
}
