:root {
    --bg-color: #f7f9fa;
    --panel-bg: #ffffff;
    --border-color: #e2e8f0;
    --text-main: #1f2937;
    --text-muted: #6b7280;
    --accent-green: #297645;
    --accent-green-light: #e8f5ed;
    --btn-hover: #1e5a34;
    --code-bg: #f3f4f6;
    
    /* Code colors */
    --code-selector: #996e38;
    --code-property: #2c668c;
    --code-value: #9e433a;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    width: 100%;
    overflow-x: hidden;
}

img {
    max-width: 100%;
    height: auto;
}

.app-wrapper {
    display: flex;
    gap: 16px;
    background-color: transparent;
    padding: 16px;
    width: min(1100px, 100%);
    max-width: 100%;
    margin: auto;
}

.panel {
    flex: 1;
    border: 1.5px solid var(--border-color);
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    background-color: var(--panel-bg);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.05);
}

.panel-header {
    display: flex;
    align-items: center;
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
}

.panel-header h2 {
    font-size: 16px;
    font-weight: 500;
    margin-left: 12px;
}

.icon-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: none;
    background-color: #f1f5f9;
    color: var(--text-muted);
    cursor: pointer;
    transition: background-color 0.2s;
}

.icon-btn:hover {
    background-color: #e2e8f0;
}

.panel-header .spacer {
    flex: 1;
}

.settings-btn {
    margin-left: auto;
    background-color: transparent;
}
.settings-btn:hover {
    background-color: #f1f5f9;
}

/* Game View specifics */
.game-content {
    padding: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
}

.level-title {
    color: var(--accent-green);
    font-weight: 500;
    font-size: 15px;
    margin-bottom: 8px;
    text-align: center;
}

.level-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
    font-size: 12px;
    color: var(--text-muted);
}

.level-difficulty,
.level-progress {
    border: 1px solid var(--border-color);
    border-radius: 999px;
    padding: 4px 10px;
    background-color: #f8fafc;
}

.game-area {
    position: relative;
    width: 100%;
    height: 300px;
}

.grid-bg {
    position: absolute;
    inset: 0;
    background-image: radial-gradient(circle, #297645 1px, transparent 1px);
    background-size: 20px 20px;
    opacity: 0.15;
    -webkit-mask-image: radial-gradient(circle, black 20%, transparent 70%);
    mask-image: radial-gradient(circle, black 20%, transparent 70%);
}

.target-container {
    position: absolute;
    inset: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 5;
    padding: 20px;
}

.target {
    width: 70px;
    height: 70px;
    border: 2px dashed rgba(41, 118, 69, 0.5);
    border-radius: 12px;
    background-color: rgba(41, 118, 69, 0.05);
}

.items-container {
    position: absolute;
    inset: 0;
    display: flex;
    gap: 12px;
    z-index: 10;
    padding: 20px;
}

.item {
    width: 70px;
    height: 70px;
    background-color: #c4d3d1;
    border: 1px solid #94a3b8;
    border-radius: 12px;
    box-shadow: inset 0 2px 4px rgba(255,255,255,0.4), 0 4px 12px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.item.success {
    background-color: var(--accent-green);
    border-color: var(--btn-hover);
    box-shadow: 0 0 15px rgba(41, 118, 69, 0.4), inset 0 2px 4px rgba(255,255,255,0.2);
}

.compact-squares .target,
.compact-squares .item {
    width: 52px;
    height: 52px;
}

/* Axes */
.axis {
    position: absolute;
    display: flex;
    align-items: center;
    z-index: 5;
    background-color: var(--accent-green);
}

.x-axis {
    width: 85%;
    height: 1.5px;
    top: 50%;
    left: 7.5%;
    transform: translateY(-50%);
}

.x-axis::after {
    content: '';
    position: absolute;
    right: -4px;
    top: -3.5px;
    border-top: 4px solid transparent;
    border-bottom: 4px solid transparent;
    border-left: 6px solid var(--accent-green);
}

.y-axis {
    height: 85%;
    width: 1.5px;
    left: 50%;
    top: 7.5%;
    transform: translateX(-50%);
}

.y-axis::before {
    content: '';
    position: absolute;
    top: -4px;
    left: -3.5px;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-bottom: 6px solid var(--accent-green);
}

.axis-label-x {
    position: absolute;
    font-size: 11px;
    color: var(--text-main);
    right: 0;
    bottom: -20px;
    font-weight: 500;
}

.axis-label-y {
    position: absolute;
    font-size: 11px;
    color: var(--text-main);
    top: 0;
    right: 12px;
    transform: rotate(-90deg);
    transform-origin: right top;
    font-weight: 500;
    white-space: nowrap;
}

.level-explication {
    padding: 0 24px;
    margin-top: 4px;
    color: var(--text-muted);
    font-size: 14px;
    line-height: 1.5;
}

.level-explication strong {
    color: var(--text-main);
    font-weight: 600;
}

.level-feedback {
    min-height: 20px;
    padding: 8px 24px 0;
    color: var(--accent-green);
    font-size: 14px;
    font-weight: 500;
}

.level-feedback.error {
    color: #b42318;
}

.inline-code {
    background-color: var(--code-bg);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 13px;
    color: var(--code-value);
    border: 1px solid var(--border-color);
}

/* Code Editor specifics */
.editor-content {
    padding: 24px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.code-block {
    background-color: var(--code-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px;
    flex: 1;
    display: flex;
    flex-direction: column;
    margin-bottom: 24px;
    overflow: hidden;
}

/* Éditeur : hauteur fixe + scroll, sans agrandir la carte */
.page-game .code-editor-panel {
    min-width: 0;
    overflow: hidden;
}

.page-game .editor-content {
    min-width: 0;
    min-height: 0;
}

.page-game .code-block {
    flex: 0 0 auto;
    height: 260px;
    max-height: 260px;
    min-height: 0;
    min-width: 0;
    overflow: hidden;
}

.page-game .CodeMirror {
    height: 100% !important;
    width: 100% !important;
    max-width: 100%;
    flex: none;
}

.page-game .CodeMirror-scroll {
    min-height: 0 !important;
}

.page-game .CodeMirror-sizer,
.page-game .CodeMirror-lines {
    max-width: 100%;
}

/* CodeMirror custom styling */
.CodeMirror {
    height: 100% !important;
    flex: 1;
    background: transparent !important;
    font-family: 'Courier New', Courier, monospace !important;
    font-size: 15px !important;
    line-height: 1.6 !important;
    color: var(--text-main) !important;
}

.CodeMirror-gutters {
    background: transparent !important;
    border-right: none !important;
}

.CodeMirror .cm-protected {
    background: rgba(41, 118, 69, 0.08);
    color: #4b5563;
}

.CodeMirror-hints {
    border: 1px solid #c5dfd0 !important;
    border-radius: 10px !important;
    box-shadow: 0 12px 30px rgba(20, 50, 30, 0.15) !important;
    font-family: 'Courier New', Courier, monospace !important;
    font-size: 13px !important;
    z-index: 1000 !important;
}

.CodeMirror-hint {
    padding: 6px 10px !important;
    color: #1f2937 !important;
}

.CodeMirror-hint-active {
    background: var(--accent-green) !important;
    color: #fff !important;
}

.validate-btn {
    background-color: var(--accent-green);
    color: white;
    border: none;
    border-radius: 24px;
    padding: 16px;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
    width: 100%;
    box-shadow: 0 4px 6px rgba(41, 118, 69, 0.2);
}

.validate-btn:hover {
    background-color: var(--btn-hover);
}

.validate-btn:active {
    transform: scale(0.98);
}

/* Header Styles */
.main-site-header {
    width: 100%;
    background-color: var(--panel-bg);
    padding: 14px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 2px 10px rgba(0,0,0,0.02);
    position: relative;
    z-index: 40;
}

.main-site-header .logo {
    font-size: 20px;
    font-weight: 600;
    color: var(--accent-green);
    letter-spacing: -0.5px;
    text-decoration: none;
    z-index: 2;
}

.site-nav ul {
    list-style: none;
    display: flex;
    gap: 32px;
}

.site-nav a {
    text-decoration: none;
    color: var(--text-muted);
    font-weight: 500;
    font-size: 15px;
    transition: color 0.2s;
}

.site-nav a:hover {
    color: var(--accent-green);
}

.nav-toggle {
    display: none;
    width: 42px;
    height: 42px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: #fff;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    z-index: 2;
}

.nav-toggle-bar {
    display: block;
    width: 18px;
    height: 2px;
    background: var(--text-main);
    border-radius: 2px;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.main-site-header.is-nav-open .nav-toggle-bar:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.main-site-header.is-nav-open .nav-toggle-bar:nth-child(2) {
    opacity: 0;
}

.main-site-header.is-nav-open .nav-toggle-bar:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

.site-footer {
    width: 100%;
    margin-top: auto;
    border-top: 1px solid var(--border-color);
    background: var(--panel-bg);
}

.site-footer-inner {
    width: min(1100px, 92vw);
    margin: 0 auto;
    padding: 20px 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.site-footer p {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.site-footer-nav {
    display: flex;
    gap: 18px;
}

.site-footer-nav a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
}

.site-footer-nav a:hover {
    color: var(--accent-green);
}

.page-home .site-footer,
.page-contact .site-footer,
.page-about .site-footer {
    background: rgba(255, 255, 255, 0.92);
}

.sync-status {
    margin-left: auto;
    font-size: 12px;
    color: var(--text-muted);
    min-width: 64px;
    text-align: right;
}

.mission-brief {
    width: min(900px, 95vw);
    margin: 20px auto 0;
    padding: 0 8px;
}

.mission-brief-inner {
    background:
        linear-gradient(135deg, rgba(41, 118, 69, 0.1), rgba(41, 118, 69, 0.02)),
        var(--panel-bg);
    border: 1.5px solid var(--border-color);
    border-radius: 16px;
    padding: 20px 24px;
    box-shadow: 0 10px 30px rgba(20, 50, 30, 0.05);
}

.mission-kicker {
    color: var(--accent-green);
    font-weight: 700;
    font-size: 0.8rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin-bottom: 6px;
}

.mission-brief-inner h1 {
    font-size: 1.45rem;
    color: var(--text-main);
    margin-bottom: 8px;
}

.mission-brief-text {
    color: var(--text-muted);
    line-height: 1.55;
    max-width: 54ch;
    margin: 0;
}

.page-game .app-wrapper {
    margin-top: 12px;
}

/* —— Enigma / ghost site game —— */
.page-game,
.page-enigma {
    align-items: stretch;
    width: 100%;
}

.page-enigma {
    background:
        radial-gradient(900px 480px at 80% -20%, rgba(41, 118, 69, 0.18), transparent 55%),
        linear-gradient(180deg, #143224 0%, #1a3d2a 22%, #eef3f0 22%, #f7f9fa 100%);
}

.page-enigma .main-site-header {
    background: rgba(15, 28, 22, 0.92);
    border-bottom-color: rgba(255, 255, 255, 0.08);
}

.page-enigma .main-site-header .logo,
.page-enigma .site-nav a {
    color: #d7ebe0;
}

.page-enigma .site-nav a:hover {
    color: #fff;
}

.page-enigma .nav-toggle {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.12);
}

.page-enigma .nav-toggle-bar {
    background: #d7ebe0;
}

.mission-brief--enigma {
    width: min(1100px, 100%);
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
    padding: 0 12px;
    box-sizing: border-box;
}

.app-wrapper--enigma {
    width: min(1100px, 100%);
    max-width: 100%;
    box-sizing: border-box;
}

.mission-brief--enigma .mission-brief-inner {
    background:
        linear-gradient(135deg, rgba(20, 58, 36, 0.95), rgba(30, 90, 52, 0.88));
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #f7fbf8;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.25);
}

.mission-brief--enigma .mission-kicker {
    color: #b7e0c6;
}

.mission-brief--enigma .mission-brief-inner h1 {
    color: #fff;
    font-size: clamp(1.6rem, 3vw, 2.1rem);
}

.mission-brief--enigma .mission-brief-text {
    color: rgba(247, 251, 248, 0.88);
    max-width: 60ch;
    margin-bottom: 18px;
}

.stability-meter {
    margin-top: 8px;
}

.stability-meter-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    margin-bottom: 8px;
    color: rgba(247, 251, 248, 0.9);
}

.stability-track {
    height: 10px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.25);
    overflow: hidden;
}

.stability-fill {
    height: 100%;
    width: 0%;
    border-radius: inherit;
    background: linear-gradient(90deg, #7dcea0, #e8f5ed);
    box-shadow: 0 0 12px rgba(125, 206, 160, 0.55);
    transition: width 0.45s ease;
}

.page-enigma .panel {
    background: rgba(255, 255, 255, 0.96);
    border-color: rgba(41, 118, 69, 0.18);
}

.scene-tag {
    margin-left: auto;
    margin-right: 10px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--accent-green);
    background: var(--accent-green-light);
    border: 1px solid #c5dfd0;
    border-radius: 999px;
    padding: 5px 10px;
}

.game-area--enigma {
    border-radius: 16px;
    overflow: hidden;
    background:
        radial-gradient(circle at 30% 20%, rgba(125, 206, 160, 0.28), transparent 45%),
        linear-gradient(160deg, #1a3d2a 0%, #245239 55%, #163528 100%);
    border: 1px solid rgba(183, 224, 198, 0.35);
    box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.25);
}

.game-area--enigma .grid-bg {
    background-image: radial-gradient(circle, rgba(232, 245, 237, 0.45) 1px, transparent 1px);
    opacity: 0.35;
}

.glitch-veil {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 2px,
            rgba(255, 255, 255, 0.015) 2px,
            rgba(255, 255, 255, 0.015) 4px
        );
    opacity: 0.7;
    transition: opacity 0.4s ease;
    z-index: 6;
}

.game-area--enigma.is-repaired .glitch-veil {
    opacity: 0;
}

.game-area--enigma .target {
    border-color: rgba(183, 224, 198, 0.45);
    background: rgba(183, 224, 198, 0.06);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 0 1px rgba(183, 224, 198, 0.08);
}

.ghost-label {
    color: rgba(183, 224, 198, 0.55);
    font-weight: 700;
    font-size: 1.1rem;
}

.game-area--enigma .item {
    background: linear-gradient(160deg, #e8f5ed, #7dcea0);
    border: 2px solid #fff;
    color: #0f1c16;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    box-shadow:
        0 0 22px rgba(232, 245, 237, 0.45),
        0 8px 18px rgba(0, 0, 0, 0.25),
        inset 0 2px 4px rgba(255, 255, 255, 0.45);
}

.shard-label {
    font-size: 0.85rem;
}

.game-area--enigma .item.success {
    background: linear-gradient(160deg, #e8f5ed, #7dcea0);
    border-color: #e8f5ed;
    box-shadow:
        0 0 24px rgba(232, 245, 237, 0.55),
        inset 0 2px 4px rgba(255, 255, 255, 0.45);
    animation: shard-pulse 0.7s ease;
}

.enigma-box {
    margin: 14px 16px 0;
    padding: 14px 16px;
    border-radius: 14px;
    background:
        linear-gradient(135deg, rgba(41, 118, 69, 0.08), rgba(15, 28, 22, 0.03));
    border: 1px solid rgba(41, 118, 69, 0.18);
}

.enigma-label {
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--accent-green);
    margin-bottom: 6px;
}

.enigma-text {
    color: var(--text-main);
    line-height: 1.55;
    font-size: 0.98rem;
    margin-bottom: 12px;
}

.hint-btn {
    border: 1px solid #c5dfd0;
    background: #fff;
    color: var(--btn-hover);
    border-radius: 999px;
    padding: 8px 14px;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.2s ease, opacity 0.2s ease;
}

.hint-btn:hover:not(:disabled) {
    background: var(--accent-green-light);
}

.hint-btn:disabled {
    opacity: 0.65;
    cursor: default;
}

.hint-text {
    margin-top: 10px;
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.5;
}

.hint-text.is-hidden {
    display: none;
}

.page-enigma .level-feedback.success {
    color: var(--accent-green);
}

.page-enigma .validate-btn {
    letter-spacing: 0.3px;
}

.page-enigma .site-footer {
    background: #0f1c16;
    border-top-color: rgba(255, 255, 255, 0.08);
}

.page-enigma .site-footer p,
.page-enigma .site-footer-nav a {
    color: rgba(215, 235, 224, 0.75);
}

.page-enigma .site-footer-nav a:hover {
    color: #fff;
}

@keyframes shard-pulse {
    0% { transform: scale(0.96); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* —— Victory modal —— */
.victory-modal {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.victory-modal.is-hidden,
.victory-modal[hidden] {
    display: none !important;
}

.victory-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(8, 18, 12, 0.72);
    backdrop-filter: blur(4px);
}

.victory-modal-card {
    position: relative;
    z-index: 1;
    width: min(480px, 100%);
    background: #fff;
    border-radius: 20px;
    padding: 28px 24px 24px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
    border: 1px solid #c5dfd0;
    animation: victory-pop 0.35s ease;
    text-align: center;
}

.victory-kicker {
    color: var(--accent-green);
    font-weight: 800;
    font-size: 0.78rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 8px;
}

.victory-modal-card h2 {
    font-size: clamp(1.4rem, 3vw, 1.8rem);
    color: var(--text-main);
    margin-bottom: 10px;
    line-height: 1.25;
}

.victory-text {
    color: var(--text-muted);
    line-height: 1.55;
    margin-bottom: 22px;
}

.victory-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.victory-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 0 18px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 0.98rem;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: transform 0.15s ease, background-color 0.2s ease, border-color 0.2s ease;
}

.victory-btn:hover {
    transform: translateY(-1px);
}

.victory-btn--primary {
    background: var(--accent-green);
    color: #fff;
    box-shadow: 0 8px 18px rgba(41, 118, 69, 0.25);
}

.victory-btn--primary:hover {
    background: var(--btn-hover);
}

.victory-btn--secondary {
    background: var(--accent-green-light);
    color: var(--btn-hover);
    border: 1px solid #c5dfd0;
}

.victory-btn--ghost {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border-color);
}

.victory-note {
    margin-top: 16px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

body.victory-open {
    overflow: hidden;
}

@keyframes victory-pop {
    from {
        opacity: 0;
        transform: translateY(12px) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* —— SQL mission —— */
.page-sql {
    align-items: stretch;
    width: 100%;
    background:
        radial-gradient(900px 480px at 15% -15%, rgba(31, 111, 122, 0.2), transparent 55%),
        linear-gradient(180deg, #0f3d4c 0%, #164956 20%, #eef3f0 20%, #f7f9fa 100%);
}

.page-sql .main-site-header {
    background: rgba(15, 61, 76, 0.94);
    border-bottom-color: rgba(255, 255, 255, 0.08);
}

.page-sql .main-site-header .logo,
.page-sql .site-nav a {
    color: #d7eef1;
}

.page-sql .site-nav a:hover {
    color: #fff;
}

.page-sql .nav-toggle {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.12);
}

.page-sql .nav-toggle-bar {
    background: #d7eef1;
}

.mission-brief--sql {
    width: min(1100px, 100%);
    max-width: 100%;
    margin: 20px auto 0;
    padding: 0 12px;
    box-sizing: border-box;
}

.mission-brief--sql .mission-brief-inner {
    background: linear-gradient(135deg, #0f3d4c, #1f6f7a);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #f7fbf8;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.25);
}

.mission-brief--sql .mission-kicker {
    color: #9de4ea;
}

.mission-brief--sql .mission-brief-inner h1 {
    color: #fff;
}

.mission-brief--sql .mission-brief-text {
    color: rgba(247, 251, 248, 0.9);
    margin-bottom: 16px;
}

.app-wrapper--sql {
    width: min(1100px, 100%);
    max-width: 100%;
    box-sizing: border-box;
    align-items: flex-start;
}

.page-sql .panel {
    background: rgba(255, 255, 255, 0.97);
    min-width: 0;
    max-width: 100%;
}

.page-sql .game-view-panel {
    overflow: hidden;
}

.page-sql .game-content {
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
}

.page-sql .scene-tag {
    color: #0f3d4c;
    background: #e6f6f8;
    border-color: #b7e0e6;
}

.sql-dossier {
    align-items: stretch !important;
    width: 100%;
    min-width: 0;
    overflow: hidden;
}

.sql-tables,
.sql-result-wrap {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    margin-top: 8px;
}

.sql-tables-label,
.sql-result-label,
.sql-preview-title {
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.sql-table-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.sql-chip {
    border: 1px solid #b7e0e6;
    background: #e6f6f8;
    color: #0f3d4c;
    border-radius: 999px;
    padding: 6px 12px;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
}

.sql-chip:hover {
    background: #d2eef2;
}

.sql-table-preview,
.sql-result {
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: #f8fafc;
    padding: 10px;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    max-height: 220px;
    overflow-x: auto;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

.sql-result {
    max-height: 280px;
    min-height: 120px;
}

.sql-result table,
.sql-table-preview table {
    width: max-content;
    min-width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.sql-result th,
.sql-table-preview th,
.sql-result td,
.sql-table-preview td {
    border-bottom: 1px solid #e2e8f0;
    padding: 6px 8px;
    text-align: left;
    white-space: nowrap;
}

.sql-result th,
.sql-table-preview th {
    color: #0f3d4c;
    background: #e6f6f8;
    position: sticky;
    top: 0;
    z-index: 1;
}

.sql-result-empty,
.sql-result-error {
    color: var(--text-muted);
    font-size: 0.92rem;
    padding: 8px;
}

.sql-result-error {
    color: #b42318;
}

.sql-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.sql-actions-hint {
    margin-top: 10px;
    font-size: 0.82rem;
    color: var(--text-muted);
    line-height: 1.4;
}

.sql-story-alert {
    margin: 0 0 10px;
    padding: 10px 12px;
    border-radius: 10px;
    background: #fff4e5;
    border: 1px solid #f5c542;
    color: #8a5a00;
    font-weight: 700;
}

.sql-story-time {
    margin: 0 0 10px;
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #1f6f7a;
}

.sql-story-time--urgent {
    color: #b42318;
}

.enigma-text p {
    margin: 0 0 10px;
    line-height: 1.55;
}

.enigma-text p:last-child {
    margin-bottom: 0;
}

.sql-victory-result {
    margin: 16px 0;
    max-height: 240px;
    max-width: 100%;
    min-width: 0;
    overflow: auto;
    overscroll-behavior: contain;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: #f8fafc;
    padding: 8px;
}

.sql-victory-result table {
    width: max-content;
    min-width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.sql-run-btn {
    background: #1f6f7a;
    box-shadow: 0 4px 6px rgba(31, 111, 122, 0.25);
}

.sql-run-btn:hover {
    background: #165560;
}

.sql-check-btn {
    background: var(--accent-green);
    color: #fff;
    border: none;
    border-radius: 24px;
    padding: 16px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(41, 118, 69, 0.2);
}

.sql-check-btn:hover {
    background: var(--btn-hover);
}

.page-sql .site-footer {
    background: #0f3d4c;
    border-top-color: rgba(255, 255, 255, 0.08);
}

/* Hub SQL — liste des enquêtes */
.sql-hub {
    width: 100%;
    flex: 1;
}

.sql-hub-list {
    width: min(1100px, 100%);
    margin: 0 auto;
    padding: 8px 16px 40px;
    box-sizing: border-box;
}

.sql-hub-toolbar {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 22px;
}

.sql-hub-back {
    color: #0f3d4c;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
}

.sql-hub-back:hover {
    text-decoration: underline;
}

.sql-hub-toolbar h2 {
    font-size: 1.15rem;
    color: var(--text-main);
}

.page-sql-hub .sql-mission-kicker {
    margin: 0;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #1f6f7a;
}

.page-sql-hub .game-card-media {
    background: #0f3d4c;
}

.page-sql-hub .site-footer {
    background: #0f3d4c;
    border-top-color: rgba(255, 255, 255, 0.08);
}

.page-css-hub .sql-mission-kicker {
    margin: 0 0 4px;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #2563eb;
}

.page-css-hub .game-card-media {
    background: #0f172a;
}

.page-sql .site-footer p,
.page-sql .site-footer-nav a {
    color: rgba(215, 238, 241, 0.8);
}

.page-sql .site-footer-nav a:hover {
    color: #fff;
}

@media (max-width: 800px) {
    .page-sql {
        background:
            radial-gradient(700px 360px at 20% -10%, rgba(31, 111, 122, 0.22), transparent 55%),
            linear-gradient(180deg, #0f3d4c 0%, #164956 16%, #eef3f0 16%, #f7f9fa 100%);
    }

    .sql-actions {
        grid-template-columns: 1fr;
    }
}

.page-shell {
    width: min(900px, 95vw);
    margin: 32px auto 48px;
    padding: 0 8px;
}

.page-shell.narrow {
    width: min(640px, 95vw);
}

.page-shell h1 {
    font-size: 2rem;
    margin-bottom: 12px;
}

.page-shell h2 {
    font-size: 1.35rem;
    margin-bottom: 8px;
}

.page-shell p {
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 12px;
}

.primary-link {
    display: inline-block;
    background: var(--accent-green);
    color: #fff;
    text-decoration: none;
    font-weight: 600;
    padding: 12px 18px;
    border-radius: 999px;
    box-shadow: 0 4px 6px rgba(41, 118, 69, 0.2);
}

.primary-link:hover {
    background: var(--btn-hover);
}

/* —— Contact (layout type Sarab) —— */
.page-contact {
    align-items: stretch;
    background:
        radial-gradient(900px 420px at 10% -10%, rgba(41, 118, 69, 0.12), transparent 55%),
        linear-gradient(180deg, #f3f7f4 0%, var(--bg-color) 45%, #eef3f0 100%);
}

.contact-page {
    width: 100%;
}

.contact-hero {
    width: min(1100px, 92vw);
    margin: 0 auto;
    padding: 48px 0 28px;
    text-align: center;
}

.contact-eyebrow {
    display: inline-block;
    color: var(--accent-green);
    font-weight: 700;
    font-size: 0.82rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 10px;
}

.contact-hero h1 {
    font-size: clamp(2rem, 4vw, 3rem);
    color: var(--text-main);
    margin-bottom: 12px;
    letter-spacing: -0.02em;
}

.contact-hero-text {
    max-width: 42ch;
    margin: 0 auto;
    color: var(--text-muted);
    line-height: 1.6;
    font-size: 1.05rem;
}

.contact-main {
    width: 100%;
    padding: 12px 0 64px;
}

.contact-main-inner {
    width: min(1100px, 92vw);
    margin: 0 auto;
    display: grid;
    grid-template-columns: minmax(260px, 0.95fr) minmax(300px, 1.25fr);
    gap: 24px;
    align-items: stretch;
}

.contact-talk,
.contact-form-card {
    background: var(--panel-bg);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    box-shadow: 0 16px 40px rgba(20, 50, 30, 0.07);
}

.contact-talk {
    padding: 28px 26px;
    background:
        linear-gradient(160deg, #1e5a34 0%, #297645 55%, #3d8f5c 100%);
    color: #f7fbf8;
    border: none;
}

.contact-talk h2 {
    font-size: 1.5rem;
    margin-bottom: 10px;
    color: #fff;
}

.contact-talk-lead {
    color: rgba(247, 251, 248, 0.88);
    line-height: 1.55;
    margin-bottom: 28px;
    font-size: 0.98rem;
}

.contact-info-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.contact-info-item {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    padding: 14px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.14);
}

.contact-info-icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.16);
    color: #fff;
}

.contact-info-item strong {
    display: block;
    font-size: 0.78rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    opacity: 0.85;
    margin-bottom: 4px;
}

.contact-info-item a,
.contact-info-item span {
    color: #fff;
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    line-height: 1.35;
}

.contact-info-item a:hover {
    text-decoration: underline;
}

.contact-form-card {
    padding: 28px 26px;
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.contact-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.contact-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.contact-field label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-main);
}

.contact-field input,
.contact-field textarea,
.contact-field select {
    width: 100%;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 13px 14px;
    font: inherit;
    color: var(--text-main);
    background: #f8faf9;
    resize: vertical;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.contact-field input:focus,
.contact-field textarea:focus,
.contact-field select:focus {
    outline: none;
    border-color: var(--accent-green);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(41, 118, 69, 0.15);
}

.contact-field-error,
.contact-form-errors {
    color: #b42318;
    font-size: 0.85rem;
}

.contact-messages {
    list-style: none;
    margin: 0 0 16px;
    padding: 0;
}

.contact-message {
    padding: 14px 16px;
    border-radius: 12px;
    font-size: 0.95rem;
    line-height: 1.45;
}

.contact-message--success {
    background: var(--accent-green-light);
    color: var(--btn-hover);
    border: 1px solid #c5dfd0;
}

.contact-message--error {
    background: #fef3f2;
    color: #b42318;
    border: 1px solid #fecdca;
}

.contact-submit {
    align-self: flex-start;
    margin-top: 4px;
    background: var(--accent-green);
    color: #fff;
    border: none;
    border-radius: 12px;
    padding: 14px 28px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(41, 118, 69, 0.25);
    transition: background-color 0.2s ease, transform 0.15s ease;
}

.contact-submit:hover {
    background: var(--btn-hover);
    transform: translateY(-1px);
}

.contact-submit:active {
    transform: scale(0.98);
}

/* —— About (layout type Sarab Our Story) —— */
.page-about {
    align-items: stretch;
    background:
        radial-gradient(900px 420px at 90% -10%, rgba(41, 118, 69, 0.12), transparent 55%),
        linear-gradient(180deg, #f3f7f4 0%, var(--bg-color) 40%, #eef3f0 100%);
}

.about-page {
    width: 100%;
}

.about-eyebrow {
    display: inline-block;
    color: var(--accent-green);
    font-weight: 700;
    font-size: 0.82rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 10px;
}

.about-hero {
    width: 100%;
    padding: 48px 0 20px;
}

.about-hero-inner {
    width: min(1100px, 92vw);
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1.3fr 0.9fr;
    gap: 28px;
    align-items: center;
}

.about-hero-copy h1 {
    font-size: clamp(2rem, 4.2vw, 3.1rem);
    line-height: 1.12;
    letter-spacing: -0.02em;
    color: var(--text-main);
    margin-bottom: 14px;
    max-width: 14ch;
}

.about-hero-text {
    color: var(--text-muted);
    line-height: 1.65;
    font-size: 1.05rem;
    max-width: 42ch;
    margin-bottom: 24px;
}

.about-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 0 22px;
    border-radius: 12px;
    background: var(--accent-green);
    color: #fff;
    text-decoration: none;
    font-weight: 700;
    box-shadow: 0 8px 20px rgba(41, 118, 69, 0.22);
    transition: background-color 0.2s ease, transform 0.15s ease;
}

.about-cta:hover {
    background: var(--btn-hover);
    transform: translateY(-1px);
}

.about-cta--light {
    background: #fff;
    color: var(--btn-hover);
}

.about-cta--light:hover {
    background: #f3f7f4;
}

.about-cta--ghost {
    background: transparent;
    color: #fff;
    border: 1.5px solid rgba(255, 255, 255, 0.55);
    box-shadow: none;
}

.about-cta--ghost:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: #fff;
}

.about-hero-panel {
    display: grid;
    gap: 12px;
    padding: 22px;
    border-radius: 20px;
    background:
        linear-gradient(160deg, #1e5a34 0%, #297645 55%, #3d8f5c 100%);
    color: #fff;
    box-shadow: 0 16px 40px rgba(20, 50, 30, 0.18);
}

.about-hero-stat {
    padding: 14px 16px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.14);
}

.about-hero-stat strong {
    display: block;
    font-size: 1.8rem;
    line-height: 1;
    margin-bottom: 6px;
}

.about-hero-stat span {
    font-size: 0.92rem;
    opacity: 0.9;
}

.about-story {
    padding: 40px 0 20px;
}

.about-story-inner,
.about-journey-inner,
.about-cta-band-inner {
    width: min(1100px, 92vw);
    margin: 0 auto;
}

.about-story-inner h2,
.about-journey-inner h2 {
    font-size: clamp(1.6rem, 3vw, 2.2rem);
    color: var(--text-main);
    margin-bottom: 12px;
    max-width: 18ch;
    line-height: 1.2;
}

.about-story-lead,
.about-journey-lead {
    color: var(--text-muted);
    line-height: 1.65;
    max-width: 54ch;
    margin-bottom: 28px;
}

.about-features {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
}

.about-feature {
    background: var(--panel-bg);
    border: 1px solid var(--border-color);
    border-radius: 18px;
    padding: 22px;
    box-shadow: 0 12px 30px rgba(20, 50, 30, 0.05);
}

.about-feature-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-green-light);
    color: var(--accent-green);
    margin-bottom: 14px;
}

.about-feature h3 {
    font-size: 1.1rem;
    margin-bottom: 8px;
    color: var(--text-main);
}

.about-feature p {
    color: var(--text-muted);
    line-height: 1.55;
    font-size: 0.95rem;
}

.about-journey {
    padding: 36px 0 48px;
}

.about-timeline {
    list-style: none;
    display: grid;
    gap: 14px;
}

.about-timeline-item {
    display: grid;
    grid-template-columns: 72px 1fr;
    gap: 16px;
    align-items: start;
    background: var(--panel-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 18px 20px;
    box-shadow: 0 10px 28px rgba(20, 50, 30, 0.04);
}

.about-timeline-year {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    border-radius: 12px;
    background: var(--accent-green-light);
    color: var(--accent-green);
    font-weight: 800;
    font-size: 1rem;
}

.about-timeline-item h3 {
    font-size: 1.05rem;
    margin-bottom: 6px;
    color: var(--text-main);
}

.about-timeline-item p {
    color: var(--text-muted);
    line-height: 1.55;
    font-size: 0.95rem;
}

.about-cta-band {
    width: 100%;
    padding: 0 0 64px;
}

.about-cta-band-inner {
    border-radius: 22px;
    padding: 36px 28px;
    text-align: center;
    color: #fff;
    background:
        linear-gradient(115deg, rgba(14, 46, 28, 0.95) 8%, rgba(41, 118, 69, 0.92) 55%, rgba(30, 90, 52, 0.95) 100%);
    box-shadow: 0 18px 40px rgba(20, 50, 30, 0.16);
}

.about-cta-band-inner h2 {
    font-size: clamp(1.5rem, 3vw, 2rem);
    margin-bottom: 8px;
}

.about-cta-band-inner p {
    opacity: 0.9;
    margin-bottom: 22px;
}

.about-cta-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
}

/* —— Home landing —— */
.page-home {
    align-items: stretch;
    font-family: "Source Sans 3", "Segoe UI", sans-serif;
    background:
        radial-gradient(1200px 500px at 80% -10%, rgba(41, 118, 69, 0.16), transparent 60%),
        linear-gradient(180deg, #f3f7f4 0%, var(--bg-color) 42%, #eef3f0 100%);
}

.page-home .main-site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    background: rgba(255, 255, 255, 0.86);
    backdrop-filter: blur(10px);
}

.page-home .logo {
    font-family: Fraunces, Georgia, serif;
    font-weight: 700;
}

.home {
    width: 100%;
}

.home-hero {
    position: relative;
    min-height: calc(100vh - 72px);
    width: 100%;
    display: grid;
    align-items: end;
    overflow: hidden;
    color: #f7fbf8;
    background:
        linear-gradient(115deg, rgba(14, 46, 28, 0.88) 8%, rgba(41, 118, 69, 0.72) 48%, rgba(20, 58, 36, 0.55) 100%),
        radial-gradient(circle at 70% 40%, #4fa36a 0%, #1e5a34 55%, #123222 100%);
}

.home-hero-visual {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.home-hero-glow {
    position: absolute;
    width: 55vw;
    max-width: 720px;
    aspect-ratio: 1;
    right: -8%;
    top: 10%;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(232, 245, 237, 0.28), transparent 68%);
    animation: home-pulse 7s ease-in-out infinite;
}

.home-hero-board {
    position: absolute;
    right: 8%;
    top: 50%;
    width: min(420px, 42vw);
    height: min(280px, 36vw);
    transform: translateY(-52%);
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 28px;
    background: rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(2px);
}

.home-float-square,
.home-float-target {
    position: absolute;
    width: 64px;
    height: 64px;
    border-radius: 14px;
}

.home-float-square {
    background: #d7ebe0;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
}

.home-float-square--a {
    left: 14%;
    top: 18%;
    animation: home-float 5.5s ease-in-out infinite;
}

.home-float-square--b {
    left: 42%;
    top: 38%;
    background: #fff;
    animation: home-float 6.2s ease-in-out infinite 0.4s;
}

.home-float-square--c {
    right: 16%;
    bottom: 18%;
    background: #9fcfb3;
    animation: home-float 5.8s ease-in-out infinite 0.8s;
}

.home-float-target {
    left: 42%;
    top: 38%;
    border: 2px dashed rgba(255, 255, 255, 0.7);
    background: transparent;
    animation: home-target 6.2s ease-in-out infinite 0.4s;
}

.home-hero-content {
    position: relative;
    z-index: 2;
    width: min(1100px, 92vw);
    margin: 0 auto;
    padding: 7vh 0 8vh;
    animation: home-rise 0.9s ease-out both;
}

.home-brand {
    font-family: Fraunces, Georgia, serif;
    font-size: clamp(3.4rem, 9vw, 6.4rem);
    font-weight: 700;
    line-height: 0.95;
    letter-spacing: -0.04em;
    margin-bottom: 18px;
    color: #fff;
}

.home-headline {
    font-family: Fraunces, Georgia, serif;
    font-size: clamp(1.45rem, 3.2vw, 2.15rem);
    font-weight: 600;
    max-width: 14ch;
    line-height: 1.2;
    margin-bottom: 14px;
    color: #eef7f1;
}

.home-lead {
    max-width: 34ch;
    font-size: 1.08rem;
    line-height: 1.55;
    color: rgba(247, 251, 248, 0.88);
    margin-bottom: 28px;
}

.home-cta-group {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.home-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 0 20px;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.98rem;
    transition: transform 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
}

.home-cta:hover {
    transform: translateY(-1px);
}

.home-cta--primary {
    background: #fff;
    color: #1e5a34;
}

.home-cta--ghost {
    border: 1.5px solid rgba(255, 255, 255, 0.55);
    color: #fff;
    background: transparent;
}

.home-cta--ghost:hover {
    border-color: #fff;
    background: rgba(255, 255, 255, 0.08);
}

.home-situations {
    width: 100%;
    padding: 64px 0 80px;
}

.home-situations-inner {
    width: min(1100px, 92vw);
    margin: 0 auto;
}

.home-situations-header {
    margin-bottom: 28px;
    max-width: 42rem;
}

.home-situations-header h2 {
    font-family: Fraunces, Georgia, serif;
    font-size: clamp(1.7rem, 3vw, 2.2rem);
    color: var(--text-main);
    margin-bottom: 8px;
}

.home-situations-header p {
    color: var(--text-muted);
    line-height: 1.6;
}

.game-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 22px;
}

.game-card {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--panel-bg);
    border: 1px solid var(--border-color);
    border-radius: 18px;
    text-decoration: none;
    color: inherit;
    box-shadow: 0 12px 30px rgba(20, 50, 30, 0.06);
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.game-card:hover {
    transform: translateY(-4px);
    border-color: #b7d4c2;
    box-shadow: 0 18px 40px rgba(20, 50, 30, 0.12);
}

.game-card--soon {
    cursor: default;
    opacity: 0.92;
}

.game-card--soon:hover {
    transform: none;
    border-color: var(--border-color);
    box-shadow: 0 12px 30px rgba(20, 50, 30, 0.06);
}

.game-card--soon:hover .game-card-media img {
    transform: none;
}

.game-card-media {
    position: relative;
    aspect-ratio: 16 / 10;
    min-height: 160px;
    overflow: hidden;
    background: #1e5a34;
}

.game-card-media img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    max-width: none;
    object-fit: cover;
    display: block;
    transition: transform 0.45s ease;
}

.game-card:hover .game-card-media img {
    transform: scale(1.04);
}

.game-card-badge {
    position: absolute;
    left: 12px;
    bottom: 12px;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(15, 40, 25, 0.72);
    color: #fff;
    font-size: 0.78rem;
    font-weight: 600;
    backdrop-filter: blur(4px);
}

.game-card-body {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 18px 18px 20px;
    flex: 1;
}

.game-card-body h3 {
    font-family: Fraunces, Georgia, serif;
    font-size: 1.25rem;
    color: var(--text-main);
}

.game-card-body p {
    color: var(--text-muted);
    line-height: 1.5;
    font-size: 0.95rem;
    flex: 1;
}

.game-card-action {
    margin-top: 8px;
    color: var(--accent-green);
    font-weight: 700;
    font-size: 0.92rem;
}

.game-card-badge--soon,
.game-card-action--soon {
    color: #6b7280;
}

.game-card-badge--soon {
    background: rgba(31, 41, 55, 0.72);
    color: #fff;
}

.game-card-action--soon {
    color: var(--text-muted);
    font-weight: 600;
}

.game-empty {
    grid-column: 1 / -1;
    color: var(--text-muted);
}

@keyframes home-rise {
    from {
        opacity: 0;
        transform: translateY(18px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes home-float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

@keyframes home-target {
    0%, 100% { transform: translateY(0) scale(1); opacity: 0.85; }
    50% { transform: translateY(-10px) scale(1.04); opacity: 1; }
}

@keyframes home-pulse {
    0%, 100% { opacity: 0.75; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.05); }
}

/* —— Responsive —— */
@media (max-width: 1100px) {
    .app-wrapper {
        width: min(960px, 100%);
        padding: 16px 12px;
    }

    .mission-brief {
        width: min(960px, 100%);
        padding: 0 12px;
    }
}

@media (max-width: 900px) {
    .home-hero-board {
        opacity: 0.28;
        right: -6%;
        width: min(340px, 48vw);
        height: min(220px, 34vw);
    }

    .home-float-square,
    .home-float-target {
        width: 48px;
        height: 48px;
    }

    .home-headline {
        max-width: 18ch;
    }

    .game-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
        gap: 16px;
    }
}

@media (max-width: 800px) {
    .main-site-header {
        padding: 12px 16px;
        flex-wrap: wrap;
    }

    .nav-toggle {
        display: inline-flex;
        margin-left: auto;
    }

    .site-nav {
        display: none;
        width: 100%;
        order: 3;
        padding: 8px 0 4px;
    }

    .main-site-header.is-nav-open .site-nav {
        display: block;
    }

    .site-nav ul {
        flex-direction: column;
        gap: 0;
        border: 1px solid var(--border-color);
        border-radius: 12px;
        overflow: hidden;
        background: #fff;
    }

    .site-nav a {
        display: block;
        padding: 14px 16px;
        border-bottom: 1px solid var(--border-color);
    }

    .site-nav li:last-child a {
        border-bottom: none;
    }

    .app-wrapper {
        flex-direction: column;
        width: 100%;
        gap: 12px;
        padding: 12px;
        margin: 0;
    }

    .panel {
        min-width: 0;
        width: 100%;
    }

    .game-view-panel {
        order: 1;
    }

    .code-editor-panel {
        order: 2;
    }

    .game-content,
    .editor-content,
    .level-explication,
    .level-feedback {
        padding-left: 16px;
        padding-right: 16px;
    }

    .game-content {
        padding-top: 16px;
        padding-bottom: 16px;
    }

    .editor-content {
        padding-top: 16px;
        padding-bottom: 16px;
    }

    .level-explication {
        padding-top: 0;
        margin-top: 12px;
    }

    .level-feedback {
        padding-top: 8px;
    }

    .level-title {
        font-size: 14px;
        padding: 0 8px;
    }

    .game-area {
        height: min(52vw, 280px);
        min-height: 220px;
    }

    .target,
    .item {
        width: 56px;
        height: 56px;
    }

    .compact-squares .target,
    .compact-squares .item {
        width: 40px;
        height: 40px;
    }

    .target-container,
    .items-container {
        padding: 12px;
    }

    .code-block {
        height: 200px;
        max-height: 200px;
        min-height: 0;
        margin-bottom: 16px;
        padding: 12px;
    }

    .CodeMirror {
        min-height: 0;
        font-size: 14px !important;
    }

    .validate-btn {
        padding: 14px;
        font-size: 14px;
        border-radius: 16px;
    }

    .mission-brief {
        width: 100%;
        margin-top: 12px;
        padding: 0 12px;
    }

    .mission-brief-inner {
        padding: 16px;
        border-radius: 14px;
    }

    .mission-brief-inner h1 {
        font-size: 1.25rem;
    }

    .page-enigma {
        background:
            radial-gradient(700px 360px at 80% -10%, rgba(41, 118, 69, 0.2), transparent 55%),
            linear-gradient(180deg, #143224 0%, #1a3d2a 18%, #eef3f0 18%, #f7f9fa 100%);
    }

    .scene-tag {
        margin-left: 8px;
        margin-right: 0;
        max-width: 42%;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .enigma-box {
        margin: 12px 12px 0;
    }

    .page-shell {
        width: 100%;
        margin: 24px auto 40px;
        padding: 0 16px;
    }

    .page-shell h1 {
        font-size: 1.6rem;
    }

    .home-hero {
        min-height: calc(100svh - 64px);
        align-items: center;
    }

    .home-hero-content {
        padding: 8vh 0 10vh;
        width: min(100%, 92vw);
    }

    .home-cta-group {
        gap: 10px;
    }

    .home-cta {
        flex: 0 1 auto;
        min-height: 42px;
        padding: 0 16px;
        font-size: 0.9rem;
        border-radius: 10px;
    }

    .home-situations {
        padding: 36px 0 48px;
    }

    .home-situations-inner {
        width: min(100%, 92vw);
    }

    .contact-layout {
        grid-template-columns: 1fr;
    }

    .contact-page {
        width: 100%;
    }

    .contact-main-inner {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .contact-form-grid {
        grid-template-columns: 1fr;
    }

    .contact-hero {
        padding: 32px 0 20px;
        text-align: left;
    }

    .contact-hero-text {
        margin: 0;
    }

    .contact-talk,
    .contact-form-card {
        padding: 22px 18px;
    }

    .contact-submit {
        width: 100%;
    }

    .about-hero-inner,
    .about-features {
        grid-template-columns: 1fr;
    }

    .about-hero-copy h1,
    .about-story-inner h2,
    .about-journey-inner h2 {
        max-width: none;
    }

    .about-hero {
        padding: 32px 0 8px;
    }

    .about-timeline-item {
        grid-template-columns: 56px 1fr;
        gap: 12px;
        padding: 16px;
    }

    .about-cta-band-inner {
        padding: 28px 18px;
        text-align: left;
    }

    .about-cta-actions {
        justify-content: stretch;
    }

    .about-cta-actions .about-cta {
        flex: 1 1 100%;
    }
}

@media (max-width: 560px) {
    .site-footer-inner {
        flex-direction: column;
        text-align: center;
        padding: 18px 0 24px;
    }

    .home-hero-board,
    .home-hero-glow {
        display: none;
    }

    .home-brand {
        font-size: clamp(2.6rem, 14vw, 3.6rem);
    }

    .home-headline {
        max-width: none;
        font-size: clamp(1.25rem, 6vw, 1.6rem);
    }

    .home-lead {
        max-width: none;
        font-size: 1rem;
    }

    .home-cta-group {
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        gap: 8px;
    }

    .home-cta {
        width: auto;
        flex: 0 1 auto;
        min-height: 40px;
        padding: 0 14px;
        font-size: 0.86rem;
        white-space: nowrap;
    }

    .game-grid {
        grid-template-columns: 1fr;
    }

    .game-area {
        height: 240px;
        min-height: 200px;
    }

    .target,
    .item {
        width: 48px;
        height: 48px;
        border-radius: 10px;
    }

    .compact-squares .target,
    .compact-squares .item {
        width: 34px;
        height: 34px;
        border-radius: 8px;
    }

    .level-meta {
        flex-wrap: wrap;
        justify-content: center;
        margin-bottom: 14px;
    }

    .sync-status {
        min-width: 0;
        font-size: 11px;
    }

    .panel-header {
        padding: 12px;
    }

    .panel-header h2 {
        font-size: 14px;
        margin-left: 8px;
    }
}

@media (max-width: 380px) {
    .main-site-header .logo {
        font-size: 18px;
    }

    .validate-btn {
        letter-spacing: 0;
        font-size: 13px;
    }
}

/* —— CSS Mission TechNova —— */
.page-technova {
    --tn-ink: #0f172a;
    --tn-blue: #2563eb;
    --tn-soft: #eff6ff;
}

.mission-brief--technova {
    width: min(1100px, 100%);
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
    padding: 0 12px;
    box-sizing: border-box;
}

.mission-brief--technova .mission-brief-inner {
    background:
        linear-gradient(135deg, rgba(15, 23, 42, 0.96), rgba(37, 99, 235, 0.88));
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #f8fafc;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.28);
}

.mission-brief--technova .mission-kicker {
    color: #93c5fd;
}

.mission-brief--technova .mission-brief-inner h1 {
    color: #fff;
    font-size: clamp(1.55rem, 3vw, 2.05rem);
}

.mission-brief--technova .mission-brief-text {
    color: rgba(248, 250, 252, 0.9);
    max-width: 64ch;
    margin-bottom: 18px;
}

.app-wrapper--technova {
    width: min(1100px, 100%);
    max-width: 100%;
    box-sizing: border-box;
    display: flex;
    gap: 16px;
    align-items: stretch;
}

.page-technova .panel {
    min-width: 0;
    min-height: 0;
    overflow: hidden;
}

.page-technova .technova-mission-panel,
.page-technova .technova-editor-panel {
    flex: 1;
}

.page-technova .technova-brief {
    align-items: stretch;
    text-align: left;
    overflow: auto;
}

.page-technova .technova-brief .level-title,
.page-technova .technova-brief .level-meta {
    align-self: flex-start;
    width: 100%;
}

.page-technova .technova-brief .enigma-box {
    width: 100%;
    margin-top: 8px;
    box-sizing: border-box;
}

.page-technova .technova-brief #enigma-text {
    white-space: pre-wrap;
    text-align: left;
}

.page-technova .level-feedback {
    width: 100%;
    text-align: left;
}

.technova-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 14px;
    width: 100%;
}

.technova-tool-btn,
.technova-vp-btn {
    border: 1px solid rgba(37, 99, 235, 0.35);
    background: var(--tn-soft);
    color: var(--tn-ink);
    border-radius: 8px;
    padding: 8px 12px;
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.technova-tool-btn:hover,
.technova-vp-btn:hover,
.technova-vp-btn.is-active {
    background: var(--tn-blue);
    color: #fff;
    border-color: var(--tn-blue);
}

.page-technova .technova-editor-panel .code-block {
    height: 340px;
    max-height: 340px;
}

.technova-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 4px;
}

.technova-run-btn {
    border: 0;
    border-radius: 10px;
    padding: 14px 14px;
    font: inherit;
    font-weight: 800;
    letter-spacing: 0.04em;
    cursor: pointer;
    background: #0f172a;
    color: #fff;
}

.technova-run-btn:hover {
    background: #1e293b;
}

.technova-actions .validate-btn {
    margin-top: 0;
    width: 100%;
}

.technova-editor-hint {
    margin: 10px 2px 0;
    font-size: 12px;
    color: #64748b;
    line-height: 1.45;
}

.technova-html-note {
    margin: 0;
    padding: 0 18px 10px;
    font-size: 13px;
    color: #64748b;
    line-height: 1.45;
    background: #fff;
}

.technova-html-note--modal {
    border-bottom: 1px solid #e2e8f0;
}

.technova-html-modal-card {
    width: min(860px, 100%);
}

.technova-html-modal-card .technova-html-code {
    margin: 0;
    padding: 16px 18px;
    max-height: min(65vh, 560px);
    overflow: auto;
    font-family: Consolas, "Courier New", monospace;
    font-size: 12.5px;
    line-height: 1.5;
    color: #e2e8f0;
    background: #0f172a;
    white-space: pre;
    border: 0;
    border-radius: 0;
}

.technova-preview-modal {
    position: fixed;
    inset: 0;
    z-index: 2100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.technova-preview-modal.is-hidden,
.technova-preview-modal[hidden] {
    display: none !important;
}

.technova-preview-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.72);
    backdrop-filter: blur(4px);
}

.technova-preview-modal-card {
    position: relative;
    z-index: 1;
    width: min(1180px, 100%);
    max-height: calc(100vh - 32px);
    display: flex;
    flex-direction: column;
    background: #f8fafc;
    border-radius: 18px;
    box-shadow: 0 28px 70px rgba(15, 23, 42, 0.4);
    overflow: hidden;
}

.technova-preview-modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 18px 12px;
    background: #fff;
    border-bottom: 1px solid #e2e8f0;
}

.technova-preview-modal-kicker {
    margin: 0 0 2px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #2563eb;
}

.technova-preview-modal-header h2 {
    margin: 0;
    font-size: 1.15rem;
    color: #0f172a;
}

.technova-preview-modal-tools {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.technova-viewport-btns {
    display: flex;
    gap: 6px;
}

.technova-preview-close {
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 10px;
    background: #e2e8f0;
    color: #0f172a;
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
}

.technova-preview-close:hover {
    background: #cbd5e1;
}

.technova-preview-frame-wrap {
    padding: 14px;
    background: #e2e8f0;
    flex: 1;
    min-height: 0;
    display: flex;
    justify-content: center;
    overflow: auto;
}

.technova-preview-frame {
    width: 100%;
    min-height: min(70vh, 720px);
    height: min(70vh, 720px);
    max-width: 100%;
    border: 0;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.12);
    transition: width 0.25s ease;
}

.technova-preview-modal-note {
    margin: 0;
    padding: 10px 18px 14px;
    font-size: 12px;
    color: #64748b;
    background: #fff;
    border-top: 1px solid #e2e8f0;
}

.technova-before-after {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin: 18px 0;
    text-align: center;
}

.technova-before-after > div span {
    display: block;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #64748b;
    margin-bottom: 4px;
}

.technova-before-after-arrow {
    font-size: 1.4rem;
    color: var(--tn-blue);
}

body.preview-open {
    overflow: hidden;
}

@media (max-width: 900px) {
    .app-wrapper--technova {
        flex-direction: column;
    }

    .technova-actions {
        grid-template-columns: 1fr;
    }

    .page-technova .technova-editor-panel .code-block {
        height: 260px;
        max-height: 260px;
    }

    .technova-preview-frame {
        min-height: 55vh;
        height: 55vh;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}
