/**
 * review-different-code.css — Styles dédiés au jeu Find the Diff Code Review
 * Styles propres au jeu uniquement — communs dans games.css
 */

/* ── Pill puzzle ─────────────────────────────────────────────────────────────── */
.rdc-puzzle-pill {
    display: inline-block;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: #fff;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 999px;
    font-size: .85rem;
}

/* ── Plateau : 2 panneaux côte à côte ────────────────────────────────────────── */
.rdc-board {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    align-items: stretch;
}

.rdc-pane {
    display: flex;
    flex-direction: column;
    background: #1e1e2e;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18);
    border: 1px solid #2a2a3e;
}

.rdc-pane-header {
    background: #2a2a3e;
    color: #e2e8f0;
    padding: 8px 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: .82rem;
    font-weight: 600;
    border-bottom: 1px solid #383852;
}

.rdc-pane-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}
.rdc-pane-dot--orig { background: #94a3b8; }
.rdc-pane-dot--mod  { background: #22c55e; box-shadow: 0 0 8px rgba(34, 197, 94, 0.6); }

.rdc-pane-title {
    color: #cbd5e1;
    line-height: 1.2;
}

/* ── Bloc de code ────────────────────────────────────────────────────────────── */
.rdc-code {
    margin: 0;
    padding: 0;
    background: #1e1e2e;
    color: #e2e8f0;
    font-family: 'JetBrains Mono', 'Fira Code', Consolas, 'Courier New', monospace;
    font-size: .85rem;
    line-height: 1.55;
    overflow-x: auto;
    white-space: pre;
    counter-reset: rdc-line;
    min-height: 320px;
}

/* Une "ligne" interactive */
.rdc-line {
    display: block;
    padding: 1px 12px 1px 48px;
    position: relative;
    border-left: 3px solid transparent;
    cursor: default;
    transition: background-color .15s ease;
    min-height: 1.55em;
}

.rdc-line::before {
    counter-increment: rdc-line;
    content: counter(rdc-line);
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 38px;
    text-align: right;
    padding-right: 6px;
    color: #6b7280;
    font-size: .78rem;
    line-height: 1.55;
    border-right: 1px solid #2a2a3e;
    user-select: none;
}

.rdc-code--mod .rdc-line {
    cursor: pointer;
}

.rdc-code--mod .rdc-line:hover:not(.rdc-line--found):not(.rdc-line--miss) {
    background: rgba(99, 102, 241, 0.12);
    border-left-color: #6366f1;
}

.rdc-code--mod .rdc-line.rdc-line--cursor:not(.rdc-line--found) {
    background: rgba(139, 92, 246, 0.16);
    border-left-color: #8b5cf6;
}

/* États validés */
.rdc-line--found {
    background: rgba(34, 197, 94, 0.22) !important;
    border-left-color: #22c55e !important;
    cursor: default !important;
}
.rdc-line--found::after {
    content: "✓";
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: #22c55e;
    font-weight: 800;
    font-size: 1.05rem;
}

.rdc-line--miss {
    background: rgba(239, 68, 68, 0.22) !important;
    border-left-color: #ef4444 !important;
    animation: rdc-shake .35s ease;
}

.rdc-line--hint {
    background: rgba(251, 191, 36, 0.22) !important;
    border-left-color: #fbbf24 !important;
    animation: rdc-pulse-hint 1s ease 2;
}

.rdc-line--reveal {
    background: rgba(96, 165, 250, 0.18) !important;
    border-left-color: #60a5fa !important;
}

@keyframes rdc-shake {
    0%, 100% { transform: translateX(0); }
    25%      { transform: translateX(-4px); }
    75%      { transform: translateX(4px); }
}

@keyframes rdc-pulse-hint {
    0%, 100% { box-shadow: inset 0 0 0 0 rgba(251, 191, 36, 0); }
    50%      { box-shadow: inset 0 0 0 999px rgba(251, 191, 36, 0.25); }
}

/* ── Coloration syntaxique légère (tokens) ──────────────────────────────────── */
.rdc-tk-kw   { color: #c084fc; font-weight: 600; }   /* keyword */
.rdc-tk-str  { color: #86efac; }                     /* string */
.rdc-tk-num  { color: #fbbf24; }                     /* number */
.rdc-tk-com  { color: #6b7280; font-style: italic; } /* comment */
.rdc-tk-fn   { color: #60a5fa; }                     /* function */
.rdc-tk-op   { color: #f472b6; }                     /* operator */

/* ── Bandeau de fin de partie ────────────────────────────────────────────────── */
.rdc-end-banner {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: #fff;
    border-radius: 12px;
    padding: 1rem 1.25rem;
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.28);
    display: inline-block;
    min-width: 260px;
}

.rdc-end-banner.rdc-end-banner--fail {
    background: linear-gradient(135deg, #ef4444 0%, #f97316 100%);
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.28);
}

/* ── Responsive : empile les panneaux sur mobile ─────────────────────────────── */
@media (max-width: 767.98px) {
    .rdc-board {
        grid-template-columns: 1fr;
    }
    .rdc-code {
        font-size: .78rem;
        min-height: 0;
    }
    .rdc-line {
        padding-left: 40px;
    }
    .rdc-line::before {
        width: 30px;
        font-size: .7rem;
    }
}

/* ── Dark mode adjustments (déjà foncé par défaut) ───────────────────────────── */
[data-theme="dark"] .rdc-pane {
    border-color: #1f1f2e;
}
