/* VIM Master Game - Main Styles */

body {
    font-family: 'Fira Code', monospace;
    overscroll-behavior: none; /* Prevents pull-to-refresh on mobile */
    background-attachment: fixed;
}

.vim-editor {
    white-space: pre;
    line-height: 1.5;
    caret-color: transparent;
    font-family: 'Fira Code', 'Consolas', 'Monaco', monospace;
}

.line-number {
    color: #6b7280;
    text-align: right;
    padding-right: 1rem;
    user-select: none;
}

.editor-line {
    border-radius: 0.25rem;
    padding: 0.08rem 0.2rem;
}

.editor-line.active {
    background: rgba(255, 255, 255, 0.035);
}

.cursor {
    background-color: rgba(242, 197, 92, 0.96);
    color: #1e1e1e;
    animation: blink 0.5s step-end infinite;
    border-radius: 2px;
    box-shadow: 0 0 6px rgba(242, 197, 92, 0.35);
}

@keyframes blink {
    50% {
        background-color: transparent;
        outline: 1px solid rgba(242, 197, 92, 0.85);
        color: inherit;
        box-shadow: 0 0 3px rgba(242, 197, 92, 0.2);
    }
}

.cursor.cursor-insert {
    background-color: transparent;
    border-left: 2px solid #f2c55c;
    box-shadow: 0 0 10px rgba(242, 197, 92, 0.16);
    animation: insertCursorBlink 0.5s step-end infinite;
}

@keyframes insertCursorBlink {
    50% {
        border-left-color: transparent;
    }
}

.status-bar {
    font-weight: 700;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.modal-bg {
    background-color: rgba(0,0,0,0.7);
    transition: opacity 0.3s ease;
    backdrop-filter: blur(4px);
}

.modal-content {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform, opacity;
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.45);
}

#modal-content {
    backdrop-filter: blur(10px);
}

.level-complete-flash {
    animation: flash 0.5s ease-out;
}

@keyframes flash {
    0% { box-shadow: 0 0 0 0 rgba(242, 197, 92, 0.7); }
    100% { box-shadow: 0 0 0 20px rgba(242, 197, 92, 0); }
}

.ascii-logo {
    line-height: 1.02;
    filter: drop-shadow(0 0 8px rgba(250, 204, 21, 0.3));
    animation: logoGlow 3s ease-in-out infinite alternate;
}

.ascii-logo-brand {
    display: block;
    margin-bottom: 0;
    transform: none;
    max-width: 100%;
    overflow: hidden;
    text-rendering: geometricPrecision;
}

@media (max-width: 768px) {
    .ascii-logo-brand {
        transform: none;
    }
}

@keyframes logoGlow {
    0% { filter: drop-shadow(0 0 8px rgba(250, 204, 21, 0.3)); }
    100% { filter: drop-shadow(0 0 16px rgba(250, 204, 21, 0.6)); }
}

/* Celebration styles */
.celebration-bg { 
    background: radial-gradient( circle at center, rgba(34,197,94,0.2), rgba(30,58,138,0.85) ); 
}

.celebration-overlay { 
    position: absolute; 
    inset: 0; 
    background: rgba(0,0,0,0.72); 
    backdrop-filter: blur(3px); 
}

.celebration-text {
    animation: pop 1s ease-out forwards, glow 2.5s ease-in-out infinite alternate;
}

@keyframes pop { 
    0% { transform: scale(0.8); opacity: 0 } 
    100% { transform: scale(1); opacity: 1 } 
}

@keyframes glow { 
    0% { text-shadow: 0 0 10px rgba(250,204,21,.6) } 
    100% { text-shadow: 0 0 30px rgba(250,204,21,1) } 
}

.confetti { 
    position: fixed; 
    top: -10px; 
    font-size: 18px; 
    animation: fall linear forwards; 
    pointer-events: none; 
}

@keyframes fall { 
    to { transform: translateY(110vh) rotate(360deg); opacity: .9 } 
}

/* Badges */
.badge {
    transition: all 0.3s ease;
    transform: scale(1);
}

.badge:hover {
    transform: scale(1.1);
    filter: brightness(1.2);
}

/* Badges */
.badge-card { box-shadow: 0 6px 18px rgba(30, 64, 175, 0.25); }
.badge-card:hover { transform: translateY(-1px); box-shadow: 0 10px 28px rgba(30, 64, 175, 0.4); }

/* Progress Management System */
.progress-message {
    transition: all 0.3s ease;
}

.progress-message.success {
    color: #4ade80;
    animation: fadeInUp 0.3s ease;
}

.progress-message.error {
    color: #f87171;
    animation: fadeInUp 0.3s ease;
}

.progress-message.info {
    color: #60a5fa;
    animation: fadeInUp 0.3s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Progress Code Input Styling */
#export-code, #import-code {
    font-family: 'Fira Code', 'Consolas', 'Monaco', monospace;
    transition: all 0.3s ease;
}

#export-code:focus, #import-code:focus {
    border-color: #10b981;
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2);
}

/* Progress Management Container Animations */
#export-code-container, #import-code-container {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#export-code-container.hidden, #import-code-container.hidden {
    opacity: 0;
    transform: translateY(-10px);
    pointer-events: none;
}

/* Compact Progress Management Styling */
#progress-summary {
    font-weight: 500;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* Progress Toggle Styling */
#progress-toggle {
    transition: all 0.3s ease;
    cursor: pointer;
}

#progress-toggle:hover {
    background: linear-gradient(to right, rgba(75, 85, 99, 0.8), rgba(55, 65, 81, 0.8));
    border-color: rgba(156, 163, 175, 0.5);
    transform: translateY(-1px);
}

#progress-details {
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Compact Badge Styling */
#badge-section .badge {
    font-size: 1.2rem;
    transition: all 0.2s ease;
}

#badge-section .badge:hover {
    transform: scale(1.15);
    filter: brightness(1.3);
}

/* Achievements Section Positioning */
#badge-section {
    transition: all 0.3s ease;
}

#badge-section:not(.hidden) {
    animation: fadeInUp 0.4s ease-out;
}

/* Compact Challenge Styling */
#challenge-container {
    transition: all 0.3s ease;
}

#challenge-container.hidden {
    opacity: 0;
    transform: translateY(-10px);
    pointer-events: none;
}

/* Responsive Design for Compact Layout */
@media (max-width: 768px) {
    #progress-summary {
        font-size: 0.875rem;
    }
    
    #badge-section .badge {
        font-size: 1rem;
    }
    
    #challenge-container .text-2xl {
        font-size: 1.25rem;
    }
    
    #challenge-container .text-lg {
        font-size: 1rem;
    }
}

/* Progress Summary Styling */
#progress-summary {
    font-weight: 500;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

#last-saved-time {
    font-style: italic;
    opacity: 0.8;
}

/* Button hover effects */
button {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

button:hover {
    transform: translateY(-2px);
}

/* Level selection buttons */
.level-btn {
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.level-btn:hover {
    border-color: #f2c55c;
    box-shadow: 0 0 12px rgba(242, 197, 92, 0.4);
}

.level-btn.current {
    border-color: #f2c55c;
    box-shadow: 0 0 16px rgba(242, 197, 92, 0.6);
}

.level-btn.completed {
    border-color: #10b981;
    box-shadow: 0 0 12px rgba(16, 185, 129, 0.4);
}

/* Challenge mode improvements */
#challenge-container {
    animation: slideIn 0.5s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Cheat mode improvements */
#cheat-panel {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#cheat-panel.translate-x-full {
    transform: translateX(100%);
}

#cheat-panel:not(.translate-x-full) {
    transform: translateX(0);
}

/* Input focus effects */
input:focus {
    box-shadow: 0 0 0 3px rgba(250, 204, 21, 0.1);
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(55, 65, 81, 0.5);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: rgba(156, 163, 175, 0.8);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(156, 163, 175, 1);
}

/* Responsive improvements */
@media (max-width: 768px) {
    .ascii-logo {
        font-size: 0.5rem;
    }
    
    #challenge-container {
        margin: 1rem 0;
    }
    
    .modal-content {
        margin: 1rem;
        max-width: calc(100vw - 2rem);
    }
}

/* Animation utilities */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.slide-up {
    animation: slideUp 0.5s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Enhanced cursor animations */
.cursor.insert {
    background-color: #10b981;
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.6);
}

.cursor.visual {
    background-color: #8b5cf6;
    box-shadow: 0 0 8px rgba(139, 92, 244, 0.6);
}

.cursor.search {
    background-color: #f59e0b;
    box-shadow: 0 0 8px rgba(245, 158, 11, 0.6);
}

.stat-pop {
    animation: statPop 220ms ease-out;
}

@keyframes statPop {
    0% { transform: scale(1); filter: brightness(1); }
    50% { transform: scale(1.05); filter: brightness(1.15); }
    100% { transform: scale(1); filter: brightness(1); }
}

/* First Impression Refresh */
.hud-shell {
    background: linear-gradient(180deg, rgba(17, 17, 17, 0.96), rgba(24, 24, 24, 0.92));
    backdrop-filter: blur(12px);
}

.hud-chip,
.hud-pill,
.hud-action,
.hud-link,
.hud-hint {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    white-space: nowrap;
}

.hud-chip,
.hud-pill,
.hud-hint {
    border: 1px solid rgba(75, 85, 99, 0.85);
    border-radius: 9999px;
    background: rgba(31, 41, 55, 0.72);
    padding: 0.45rem 0.8rem;
    color: #d1d5db;
}

.hud-action,
.hud-link {
    border-radius: 9999px;
    border: 1px solid rgba(75, 85, 99, 0.85);
    background: rgba(31, 41, 55, 0.78);
    color: #e5e7eb;
    padding: 0.5rem 0.9rem;
    font-weight: 700;
    transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.hud-action:hover,
.hud-link:hover {
    background: rgba(55, 65, 81, 0.92);
    border-color: rgba(250, 204, 21, 0.45);
}

.hud-kbd {
    background: #374151;
    border-radius: 0.35rem;
    border: 1px solid rgba(156, 163, 175, 0.35);
    color: #f3f4f6;
    font-size: 0.72rem;
    padding: 0.18rem 0.45rem;
}

.goal-card {
    padding: 0.9rem 1rem;
    margin-top: 0.25rem;
}

.goal-card #instructions {
    line-height: 1.15;
}

.goal-card #instructions > div {
    gap: 0.35rem;
}

.goal-card #instructions .text-5xl,
.goal-card #instructions .text-6xl {
    font-size: clamp(1.9rem, 4vw, 2.7rem) !important;
    line-height: 1;
}

.goal-card #instructions .text-lg {
    font-size: 1rem !important;
    margin-bottom: 0.35rem !important;
}

.goal-card #instructions .text-sm {
    font-size: 0.85rem !important;
}

.goal-card #instructions .my-3,
.goal-card #instructions .mt-2 {
    margin-top: 0.35rem !important;
}

.goal-card #instructions .py-3 {
    padding-top: 0.6rem !important;
    padding-bottom: 0.6rem !important;
}

#editor-container {
    margin-top: 0.25rem;
}

#editor-container > .flex:first-child {
    margin-bottom: 0.75rem;
}

#vim-editor-display {
    min-height: min(320px, 46vh);
}

#status-bar {
    min-height: 2.5rem;
    letter-spacing: 0.06em;
}

.statusline {
    font-family: 'Fira Code', 'Consolas', 'Monaco', monospace;
    background: linear-gradient(180deg, rgba(245, 158, 11, 0.98), rgba(234, 88, 12, 0.98));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15), 0 10px 24px rgba(0, 0, 0, 0.24);
    color: #111827;
}

.status-mode {
    display: inline-flex;
    align-items: center;
    min-width: 5.5rem;
    justify-content: center;
    font-weight: 900;
    letter-spacing: 0.08em;
}

.status-mode-ex {
    color: #1d4ed8;
}

.status-mode-normal {
    color: #111827;
}

.status-mode-insert {
    color: #065f46;
}

.status-mode-visual {
    color: #6d28d9;
}

.status-sep {
    opacity: 0.55;
}

.status-search {
    color: #1f2937;
}

#command-log {
    min-height: 2.5rem;
    display: flex;
    align-items: center;
}

#level-selection {
    min-height: 2.5rem;
}

#stats-bar {
    box-shadow: inset 0 0 0 1px rgba(250, 204, 21, 0.08);
}

#retention-panel {
    margin-top: 0.25rem;
}

.curriculum-shell {
    display: grid;
    gap: 0.85rem;
}

.curriculum-summary,
.curriculum-section {
    background: linear-gradient(180deg, rgba(24, 24, 24, 0.96), rgba(17, 17, 17, 0.96));
    border: 1px solid rgba(75, 85, 99, 0.8);
    border-radius: 1rem;
    box-shadow: 0 16px 34px rgba(0, 0, 0, 0.22);
}

.curriculum-summary {
    padding: 0.95rem 1rem;
    display: grid;
    gap: 0.9rem;
}

.curriculum-summary--compact {
    gap: 0.6rem;
}

.curriculum-summary-kicker,
.curriculum-section-title {
    text-transform: uppercase;
    letter-spacing: 0.16em;
    font-size: 0.72rem;
    color: #fbbf24;
}

.curriculum-summary-title {
    font-weight: 900;
    font-size: 1.15rem;
    color: #f9fafb;
    line-height: 1.15;
    margin-top: 0.35rem;
}

.curriculum-summary-subtitle,
.curriculum-progress-meta,
.curriculum-section-subtitle,
.curriculum-next,
.curriculum-locked-copy {
    color: #9ca3af;
    font-size: 0.85rem;
}

.curriculum-summary-stack {
    display: grid;
    gap: 0.8rem;
}

.curriculum-summary-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
}

.curriculum-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.6rem 0.95rem;
    border-radius: 0.85rem;
    border: 1px solid rgba(75, 85, 99, 0.85);
    background: rgba(17, 24, 39, 0.78);
    color: #d1d5db;
    font-weight: 700;
    transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.curriculum-toggle:hover {
    transform: translateY(-1px);
    border-color: rgba(250, 204, 21, 0.55);
    background: rgba(31, 41, 55, 0.95);
}

.curriculum-resume,
.curriculum-node {
    border-radius: 0.85rem;
    border: 1px solid rgba(75, 85, 99, 0.9);
    background: rgba(31, 41, 55, 0.88);
    color: #f9fafb;
    transition: transform 180ms ease, border-color 180ms ease, background 180ms ease, opacity 180ms ease;
}

.curriculum-resume {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.6rem 0.95rem;
    font-weight: 800;
}

.curriculum-resume:hover,
.curriculum-node:hover {
    transform: translateY(-1px);
    border-color: rgba(250, 204, 21, 0.55);
    background: rgba(55, 65, 81, 0.96);
}

.curriculum-next {
    font-family: 'Fira Code', 'Consolas', monospace;
}

.curriculum-progress {
    height: 0.6rem;
    border-radius: 9999px;
    overflow: hidden;
    background: rgba(31, 41, 55, 0.9);
    border: 1px solid rgba(75, 85, 99, 0.8);
}

.curriculum-progress-fill {
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #fbbf24, #f59e0b, #ef4444);
    transition: width 320ms ease;
}

.curriculum-collapsed {
    display: grid;
    gap: 0.45rem;
    padding: 0.15rem 0.1rem 0;
}

.curriculum-collapsed-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.6rem 0.8rem;
    border-radius: 0.8rem;
    border: 1px solid rgba(75, 85, 99, 0.55);
    background: rgba(17, 24, 39, 0.75);
    color: #e5e7eb;
    font-family: 'Fira Code', 'Consolas', monospace;
    font-size: 0.8rem;
}

.curriculum-collapsed-row--locked {
    color: #9ca3af;
    border-style: dashed;
}

.curriculum-collapsed-title {
    font-weight: 700;
}

.curriculum-collapsed-progress {
    color: #fbbf24;
    font-weight: 800;
    flex: 0 0 auto;
}

.curriculum-grid {
    display: grid;
    gap: 0.75rem;
    grid-template-columns: repeat(1, minmax(0, 1fr));
}

.curriculum-section {
    padding: 0.9rem 0.95rem;
}

.curriculum-section-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
}

.curriculum-section-subtitle {
    margin-top: 0.2rem;
}

.curriculum-section-badge {
    flex: 0 0 auto;
    border-radius: 9999px;
    border: 1px solid rgba(75, 85, 99, 0.75);
    background: rgba(31, 41, 55, 0.8);
    color: #e5e7eb;
    padding: 0.3rem 0.55rem;
    font-size: 0.72rem;
    font-weight: 800;
}

.curriculum-section--completed {
    border-color: rgba(34, 197, 94, 0.45);
}

.curriculum-section--current {
    border-color: rgba(250, 204, 21, 0.45);
    box-shadow: 0 18px 36px rgba(0, 0, 0, 0.28);
}

.curriculum-section--available {
    border-color: rgba(59, 130, 246, 0.3);
}

.curriculum-section--locked {
    border-style: dashed;
    opacity: 0.92;
}

.curriculum-nodes {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.8rem;
}

.curriculum-node {
    min-width: 0;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 0.7rem;
    font-family: 'Fira Code', 'Consolas', monospace;
    font-size: 0.82rem;
    white-space: nowrap;
}

.curriculum-node-state {
    width: 1rem;
    color: #fbbf24;
    text-align: center;
    flex: 0 0 auto;
}

.curriculum-node-command {
    color: #f9fafb;
    font-weight: 800;
}

.curriculum-node-name {
    color: #9ca3af;
    font-size: 0.72rem;
}

.curriculum-node--completed {
    background: rgba(17, 24, 39, 0.9);
    border-color: rgba(34, 197, 94, 0.4);
}

.curriculum-node--current {
    background: linear-gradient(180deg, rgba(254, 243, 199, 0.18), rgba(17, 24, 39, 0.95));
    border-color: rgba(250, 204, 21, 0.75);
    box-shadow: inset 0 0 0 1px rgba(250, 204, 21, 0.15);
}

.curriculum-node--available {
    border-color: rgba(59, 130, 246, 0.45);
}

.curriculum-node--locked {
    opacity: 0.72;
    border-style: dashed;
}

.curriculum-summary--compact .curriculum-next {
    max-width: 100%;
}

.curriculum-locked-copy {
    margin-top: 0.8rem;
    padding: 0.7rem 0.8rem;
    border-radius: 0.8rem;
    border: 1px solid rgba(75, 85, 99, 0.55);
    background: rgba(31, 41, 55, 0.55);
}

@media (min-width: 1024px) {
    .curriculum-summary {
        grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
        align-items: center;
    }

    .curriculum-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .retention-hub-row {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    .curriculum-node {
        font-size: 0.75rem;
    }

    .curriculum-node-name {
        display: none;
    }

    .curriculum-summary-title {
        font-size: 1.03rem;
    }

    .retention-hub-row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.retention-card {
    background: linear-gradient(180deg, rgba(24, 24, 24, 0.94), rgba(17, 17, 17, 0.94));
    border: 1px solid rgba(75, 85, 99, 0.85);
    border-radius: 1rem;
    padding: 1rem 1rem 0.95rem;
    box-shadow: 0 16px 34px rgba(0, 0, 0, 0.22);
}

.retention-hub {
    border-color: rgba(250, 204, 21, 0.35);
    background: linear-gradient(180deg, rgba(33, 24, 13, 0.95), rgba(17, 17, 17, 0.95));
}

.retention-kicker {
    color: #fbbf24;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    font-size: 0.68rem;
    margin-bottom: 0.55rem;
}

.retention-title {
    color: #f9fafb;
    font-weight: 800;
    font-size: 1.1rem;
    line-height: 1.2;
}

.retention-subtle {
    color: #9ca3af;
    font-size: 0.9rem;
    margin-top: 0.35rem;
}

.retention-subtle.mono {
    font-family: 'Fira Code', 'Consolas', monospace;
    color: #d1d5db;
}

.retention-hub-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.retention-hub-pill {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.55rem 0.7rem;
    border-radius: 0.8rem;
    border: 1px solid rgba(75, 85, 99, 0.6);
    background: rgba(31, 41, 55, 0.7);
    font-size: 0.8rem;
}

.retention-hub-label {
    color: #9ca3af;
}

.retention-hub-value {
    color: #f9fafb;
    font-weight: 800;
}

.retention-progress {
    height: 0.65rem;
    border-radius: 9999px;
    overflow: hidden;
    background: rgba(31, 41, 55, 0.9);
    border: 1px solid rgba(75, 85, 99, 0.8);
    margin-top: 0.9rem;
}

.retention-progress-fill {
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #fbbf24, #f59e0b, #ef4444);
    transition: width 320ms ease;
}

.retention-meta {
    font-size: 0.8rem;
    color: #d1d5db;
    margin-top: 0.5rem;
}

.retention-actions {
    margin-top: 0.9rem;
}

.retention-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.55rem 0.95rem;
    border-radius: 9999px;
    border: 1px solid rgba(75, 85, 99, 0.85);
    background: rgba(31, 41, 55, 0.85);
    color: #f9fafb;
    font-weight: 700;
    transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.retention-action:hover {
    transform: translateY(-1px);
    border-color: rgba(250, 204, 21, 0.55);
    background: rgba(55, 65, 81, 0.95);
}

.retention-stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.65rem;
}

.retention-stats div {
    background: rgba(31, 41, 55, 0.65);
    border: 1px solid rgba(75, 85, 99, 0.6);
    border-radius: 0.8rem;
    padding: 0.75rem 0.8rem;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.retention-stat {
    font-weight: 800;
    font-size: 1rem;
    color: #f9fafb;
}

.streak-welcome {
    border-color: rgba(34, 197, 94, 0.5) !important;
    color: #bbf7d0 !important;
}

#session-progress {
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

#session-progress-fill {
    box-shadow: 0 0 10px rgba(242, 197, 92, 0.28);
}

#badge-toast {
    opacity: 0;
    transform: translateX(-50%) translateY(8px) scale(0.98);
    transition: opacity 180ms ease, transform 180ms ease;
}

#badge-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0) scale(1);
}

#badge-toast {
    font-size: 0.95rem;
    letter-spacing: 0.02em;
}

#badge-toast::before {
    content: "🏆";
    display: inline-block;
    margin-right: 0.55rem;
    font-size: 1.2em;
    vertical-align: middle;
}

.lesson-complete-summary {
    display: flex;
    flex-direction: column;
    align-items: center;
}

#editor-feedback {
    min-width: min(320px, calc(100vw - 2rem));
    max-width: 92vw;
    border-radius: 0.9rem;
    padding: 0.85rem 1rem;
    background: rgba(17, 24, 39, 0.92);
    color: #f9fafb;
    border: 1px solid rgba(75, 85, 99, 0.85);
    box-shadow: 0 18px 36px rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(10px);
    transform: translate(-50%, -8px) scale(0.96);
    opacity: 0;
    transition: opacity 0.18s ease, transform 0.18s ease;
    text-align: center;
    white-space: pre-line;
    font-family: 'Fira Code', 'Consolas', monospace;
    letter-spacing: 0.02em;
}

#editor-feedback.show {
    opacity: 1;
    transform: translate(-50%, 0) scale(1);
}

#editor-feedback.success {
    border-color: rgba(34, 197, 94, 0.65);
    box-shadow: 0 18px 36px rgba(16, 185, 129, 0.2);
}

#editor-feedback.error {
    border-color: rgba(239, 68, 68, 0.75);
    box-shadow: 0 18px 36px rgba(239, 68, 68, 0.2);
}

@media (max-width: 768px) {
    .hud-shell {
        padding: 0.85rem;
    }

    .goal-card {
        padding: 0.8rem 0.9rem;
    }

    #vim-editor-display {
        min-height: 280px;
    }

    #editor-feedback {
        top: 5.5rem;
        min-width: min(260px, calc(100vw - 1rem));
    }
}

@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;
    }

    .cursor,
    .cursor.cursor-insert,
    .stat-pop {
        animation: none !important;
    }

    #session-progress-fill,
    #badge-toast,
    #editor-feedback {
        transition: none !important;
    }
}

 / *   V 3   A n i m a t i o n s   * / 
 @ k e y f r a m e s   s u c c e s s - p u l s e   { 
         0 %   {   b o x - s h a d o w :   0   0   0   0   r g b a ( 3 4 ,   1 9 7 ,   9 4 ,   0 . 7 ) ;   } 
         1 0 0 %   {   b o x - s h a d o w :   0   0   0   2 0 p x   r g b a ( 3 4 ,   1 9 7 ,   9 4 ,   0 ) ;   } 
 } 
 
 . s u c c e s s - p u l s e   { 
         a n i m a t i o n :   s u c c e s s - p u l s e   0 . 8 s   e a s e - o u t ; 
 } 
 
 @ k e y f r a m e s   e r r o r - f l a s h   { 
         0 %   {   b o x - s h a d o w :   0   0   0   0   r g b a ( 2 3 9 ,   6 8 ,   6 8 ,   0 . 9 ) ;   } 
         1 0 0 %   {   b o x - s h a d o w :   0   0   0   2 5 p x   r g b a ( 2 3 9 ,   6 8 ,   6 8 ,   0 ) ;   } 
 } 
 
 . e r r o r - f l a s h   { 
         a n i m a t i o n :   e r r o r - f l a s h   0 . 5 s   e a s e - o u t ; 
 } 
 
 @ k e y f r a m e s   f a d e - i n - u p   { 
         f r o m   { 
                 o p a c i t y :   0 ; 
                 t r a n s f o r m :   t r a n s l a t e Y ( 1 0 p x ) ; 
         } 
         t o   { 
                 o p a c i t y :   1 ; 
                 t r a n s f o r m :   t r a n s l a t e Y ( 0 ) ; 
         } 
 } 
 
 . f a d e - i n - u p   { 
         a n i m a t i o n :   f a d e - i n - u p   0 . 5 s   e a s e - o u t   f o r w a r d s ; 
 } 
  
 
