/* Page styles for grep.html (extracted from inline <style>) */
/* Hologram Hero Image Effects */
.hologram-container {
    position: relative;
    display: inline-block;
    max-width: 200px;
    overflow: visible;
    -webkit-mask-image: radial-gradient(ellipse 75% 80% at center, black 40%, transparent 70%);
    mask-image: radial-gradient(ellipse 75% 80% at center, black 40%, transparent 70%);
}
.hologram-image {
    max-width: 200px;
    height: auto;
    filter: contrast(1.1) saturate(1.2);
    animation: hologramPhase 4s ease-in-out infinite, hologramGlitch 8s step-end infinite;
    image-rendering: pixelated;
}
.hologram-container::before, .hologram-container::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: inherit;
    pointer-events: none;
}
.hologram-container::before {
    background: url('../assets/remilio2.png') center/contain no-repeat;
    mix-blend-mode: screen;
    opacity: 0.4;
    filter: hue-rotate(-30deg) saturate(1.5);
    animation: chromaShiftRed 3s ease-in-out infinite;
}
.hologram-container::after {
    background: url('../assets/remilio2.png') center/contain no-repeat;
    mix-blend-mode: screen;
    opacity: 0.4;
    filter: hue-rotate(30deg) saturate(1.5);
    animation: chromaShiftBlue 3s ease-in-out infinite reverse;
}
.hologram-scanlines {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: repeating-linear-gradient(0deg, transparent 0px, transparent 1px, rgba(0,0,0,0.4) 1px, rgba(0,0,0,0.4) 2px);
    pointer-events: none;
    z-index: 10;
    animation: scanlineMove 0.1s linear infinite;
}
.hologram-flicker {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(139, 233, 253, 0.03);
    pointer-events: none;
    z-index: 11;
    animation: hologramFlicker 0.15s infinite;
    mix-blend-mode: overlay;
}
@keyframes hologramPhase {
    0%, 100% { opacity: 0.95; transform: scale(1) translateY(0); filter: contrast(1.1) saturate(1.2) brightness(1); }
    25% { opacity: 0.85; transform: scale(1.01) translateY(-1px); filter: contrast(1.2) saturate(1.4) brightness(1.1); }
    50% { opacity: 0.9; transform: scale(0.99) translateY(1px); filter: contrast(1.15) saturate(1.3) brightness(0.95); }
    75% { opacity: 1; transform: scale(1.005) translateY(-0.5px); filter: contrast(1.25) saturate(1.5) brightness(1.15); }
}
@keyframes hologramGlitch {
    0%, 95%, 100% { clip-path: inset(0 0 0 0); transform: translate(0); }
    96% { clip-path: inset(20% 0 30% 0); transform: translate(-3px, 0); }
    97% { clip-path: inset(50% 0 10% 0); transform: translate(3px, 0); }
    98% { clip-path: inset(10% 0 60% 0); transform: translate(-2px, 0); }
    99% { clip-path: inset(40% 0 20% 0); transform: translate(2px, 0); }
}
@keyframes chromaShiftRed { 0%, 100% { transform: translate(-1px, 0); } 50% { transform: translate(-2px, 1px); } }
@keyframes chromaShiftBlue { 0%, 100% { transform: translate(1px, 0); } 50% { transform: translate(2px, -1px); } }
@keyframes scanlineMove { 0% { background-position: 0 0; } 100% { background-position: 0 4px; } }
@keyframes hologramFlicker {
    0%, 100% { opacity: 0.03; } 10% { opacity: 0.08; } 20% { opacity: 0.02; } 30% { opacity: 0.1; }
    40% { opacity: 0.04; } 50% { opacity: 0.15; } 60% { opacity: 0.05; } 70% { opacity: 0.12; }
    80% { opacity: 0.03; } 90% { opacity: 0.08; }
}

/* Home Link - Top Right */
.home-link {
    position: fixed;
    top: 1.2rem;
    right: 1.2rem;
    color: #8be9fd;
    text-decoration: none;
    font-size: 0.8rem;
    padding: 0.5rem 1rem;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(139, 233, 253, 0.25);
    border-radius: 8px;
    transition: all 0.3s ease;
    z-index: 100;
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.home-link:hover {
    color: #fff;
    border-color: rgba(139, 233, 253, 0.6);
    background: rgba(139, 233, 253, 0.1);
    box-shadow: 0 0 20px rgba(139, 233, 253, 0.2);
}

.home-link svg {
    width: 14px;
    height: 14px;
}

/* Reset Button - Bottom Right */
.reset-button {
    position: fixed;
    bottom: 2.5rem;
    right: 2.5rem;
    color: #ff5555;
    font-size: 0.65rem;
    padding: 0.35rem 0.6rem;
    background: rgba(0, 0, 0, 0.7);
    border: 1px solid rgba(255, 85, 85, 0.3);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 50;
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-family: inherit;
}

.reset-button:hover {
    color: #fff;
    border-color: #ff5555;
    background: rgba(255, 85, 85, 0.15);
    box-shadow: 0 0 20px rgba(255, 85, 85, 0.3);
}

.reset-button svg {
    width: 12px;
    height: 12px;
}

/* Reset Confirmation Modal */
.reset-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.reset-modal.show {
    display: flex;
}

.reset-modal-content {
    background: linear-gradient(145deg, rgba(40, 42, 54, 0.98), rgba(30, 32, 44, 0.98));
    border: 1px solid rgba(255, 85, 85, 0.3);
    border-radius: 12px;
    padding: 1.5rem;
    max-width: 350px;
    text-align: center;
}

.reset-modal-content h3 {
    color: #ff5555;
    margin-bottom: 0.8rem;
    font-size: 1.1rem;
}

.reset-modal-content p {
    color: #f8f8f2;
    font-size: 0.85rem;
    margin-bottom: 1.2rem;
}

.reset-modal-buttons {
    display: flex;
    gap: 0.8rem;
    justify-content: center;
}

.reset-modal-buttons button {
    padding: 0.5rem 1.2rem;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-size: 0.8rem;
    font-family: inherit;
    transition: all 0.2s ease;
}

.reset-confirm-btn {
    background: rgba(255, 85, 85, 0.8);
    color: #fff;
}

.reset-confirm-btn:hover {
    background: rgba(255, 85, 85, 1);
    box-shadow: 0 0 15px rgba(255, 85, 85, 0.4);
}

.reset-cancel-btn {
    background: rgba(98, 114, 164, 0.5);
    color: #f8f8f2;
}

.reset-cancel-btn:hover {
    background: rgba(98, 114, 164, 0.8);
}

/* Grep Dojo Specific Styles */
.grep-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0.5rem;
    padding-top: 0;
    background: none !important;
    border: none !important;
    box-shadow: none !important;
}

.grep-header {
    text-align: center;
    margin-bottom: 0.5rem;
}

.grep-header h1 {
    font-size: 1.4rem;
    color: #50fa7b;
    text-shadow: 0 0 20px rgba(80, 250, 123, 0.5);
    margin-bottom: 0;
    margin-top: 0.25rem;
    letter-spacing: 0.1em;
}

.grep-header h1 span {
    color: #8be9fd;
}

.grep-header .subtitle {
    color: #6272a4;
    font-size: 0.7rem;
    margin-top: 0;
}

/* Compact Stats Row - combines all stats */
.stats-row {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(139, 233, 253, 0.15);
    border-radius: 8px;
    padding: 0.4rem 0.8rem;
}

.stats-row .stat-mini {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0 0.5rem;
    border-right: 1px solid rgba(139, 233, 253, 0.15);
}

.stats-row .stat-mini:last-child {
    border-right: none;
}

.stats-row .stat-mini .label {
    font-size: 0.6rem;
    color: #6272a4;
    text-transform: uppercase;
}

.stats-row .stat-mini .value {
    font-size: 0.85rem;
    font-weight: bold;
}

.stats-row .stat-mini .value.score { color: #50fa7b; }
.stats-row .stat-mini .value.level { color: #8be9fd; }
.stats-row .stat-mini .value.streak { color: #ffb86c; }
.stats-row .stat-mini .value.accuracy { color: #8be9fd; }
.stats-row .stat-mini .value.hints { color: #ff79c6; }

/* XP Bar - more compact */
.xp-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.4rem;
    padding: 0 0.25rem;
}

.xp-row .xp-rank {
    font-size: 0.65rem;
    color: #8be9fd;
    font-weight: bold;
    white-space: nowrap;
}

.xp-row .xp-bar-wrapper {
    flex: 1;
    height: 4px;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 2px;
    overflow: hidden;
    border: 1px solid rgba(139, 233, 253, 0.2);
}

.xp-row .xp-fill {
    height: 100%;
    background: linear-gradient(90deg, #8be9fd, #50fa7b);
    border-radius: 2px;
    transition: width 0.5s ease;
}

.xp-row .xp-text {
    font-size: 0.55rem;
    color: #6272a4;
    white-space: nowrap;
}

/* Level Progress */
.level-progress {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
    height: 4px;
    margin-bottom: 0.4rem;
    overflow: hidden;
    border: 1px solid rgba(139, 233, 253, 0.1);
}

.level-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #50fa7b, #8be9fd);
    border-radius: 4px;
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 6px rgba(139, 233, 253, 0.5);
}

/* Level Progression Meter - Compact */
.level-meter {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    padding: 0.35rem 0;
    position: relative;
}

.level-meter::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 1rem;
    right: 1rem;
    height: 2px;
    background: rgba(139, 233, 253, 0.2);
    transform: translateY(-50%);
    z-index: 0;
}

.level-meter-progress {
    position: absolute;
    top: 50%;
    left: 1rem;
    height: 2px;
    background: linear-gradient(90deg, #50fa7b, #8be9fd);
    transform: translateY(-50%);
    z-index: 1;
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 6px rgba(80, 250, 123, 0.5);
}

.level-node {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.5);
    border: 2px solid rgba(139, 233, 253, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.6rem;
    font-weight: bold;
    color: #6272a4;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    z-index: 2;
}

.level-node:hover {
    transform: scale(1.15);
    border-color: rgba(139, 233, 253, 0.5);
    box-shadow: 0 0 10px rgba(139, 233, 253, 0.3);
}

.level-node.completed {
    background: rgba(80, 250, 123, 0.2);
    border-color: #50fa7b;
    color: #50fa7b;
}

.level-node.completed::after {
    content: '✓';
    position: absolute;
    top: -4px;
    right: -4px;
    font-size: 0.45rem;
    background: #50fa7b;
    color: #000;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.level-node.current {
    background: rgba(139, 233, 253, 0.25);
    border-color: #8be9fd;
    color: #8be9fd;
    box-shadow: 0 0 12px rgba(139, 233, 253, 0.4);
    animation: currentPulse 2s ease-in-out infinite;
}

.level-node.locked {
    opacity: 0.4;
    cursor: not-allowed;
}

.level-node.locked:hover {
    transform: none;
    box-shadow: none;
}

@keyframes currentPulse {
    0%, 100% { box-shadow: 0 0 12px rgba(139, 233, 253, 0.4); }
    50% { box-shadow: 0 0 18px rgba(139, 233, 253, 0.6); }
}

.level-node-tooltip {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.95);
    border: 1px solid rgba(139, 233, 253, 0.3);
    padding: 0.25rem 0.4rem;
    border-radius: 4px;
    font-size: 0.55rem;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    margin-bottom: 5px;
    color: #f8f8f2;
    z-index: 100;
}

.level-node:hover .level-node-tooltip {
    opacity: 1;
    visibility: visible;
}

/* Hints System */
.hint-btn {
    background: rgba(255, 184, 108, 0.15);
    border: 1px solid rgba(255, 184, 108, 0.4);
    color: #ffb86c;
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.75rem;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.hint-btn:hover:not(:disabled) {
    background: rgba(255, 184, 108, 0.25);
    border-color: #ffb86c;
}

.hint-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.hint-display {
    background: rgba(255, 184, 108, 0.1);
    border: 1px solid rgba(255, 184, 108, 0.3);
    border-radius: 4px;
    padding: 0.3rem 0.5rem;
    margin-top: 0.4rem;
    font-size: 0.7rem;
    color: #ffb86c;
    display: none;
}

.hint-display.show {
    display: block;
    animation: slideIn 0.3s ease;
}

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

/* Achievements Panel */
.achievements-btn {
    position: fixed;
    bottom: 2.5rem;
    left: 2.5rem;
    background: rgba(0, 0, 0, 0.7);
    border: 1px solid rgba(139, 233, 253, 0.3);
    color: #8be9fd;
    padding: 0.35rem 0.6rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.65rem;
    transition: all 0.3s ease;
    z-index: 50;
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.achievements-btn:hover {
    border-color: #8be9fd;
    box-shadow: 0 0 20px rgba(139, 233, 253, 0.3);
}

.achievement-count {
    background: #8be9fd;
    color: #000;
    padding: 0.1rem 0.4rem;
    border-radius: 10px;
    font-size: 0.65rem;
    font-weight: bold;
}

.achievements-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 200;
    backdrop-filter: blur(10px);
}

.achievements-modal.show {
    display: flex;
}

.achievements-content {
    background: rgba(20, 20, 30, 0.95);
    border: 1px solid rgba(139, 233, 253, 0.3);
    border-radius: 16px;
    padding: 2rem;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
}

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

.achievements-header h2 {
    color: #8be9fd;
    font-size: 1.3rem;
    margin: 0;
}

.achievements-close {
    background: none;
    border: none;
    color: #6272a4;
    font-size: 1.5rem;
    cursor: pointer;
    transition: color 0.3s;
}

.achievements-close:hover {
    color: #f8f8f2;
}

.achievements-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}

.achievement-card {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(139, 233, 253, 0.15);
    border-radius: 10px;
    padding: 1rem;
    text-align: center;
    transition: all 0.3s ease;
}

.achievement-card.locked {
    opacity: 0.4;
    filter: grayscale(1);
}

.achievement-card.unlocked {
    border-color: rgba(80, 250, 123, 0.4);
    background: rgba(80, 250, 123, 0.05);
}

.achievement-card.unlocked.new {
    animation: achievementGlow 2s ease-in-out;
}

@keyframes achievementGlow {
    0%, 100% { box-shadow: 0 0 0 rgba(80, 250, 123, 0); }
    50% { box-shadow: 0 0 30px rgba(80, 250, 123, 0.5); }
}

.achievement-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.achievement-name {
    color: #f8f8f2;
    font-weight: bold;
    font-size: 0.85rem;
    margin-bottom: 0.3rem;
}

.achievement-desc {
    color: #6272a4;
    font-size: 0.7rem;
}

/* Command History */
.history-container {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(139, 233, 253, 0.1);
}

.history-label {
    font-size: 0.7rem;
    color: #6272a4;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.history-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.history-item {
    font-family: 'Fira Code', 'Consolas', monospace;
    font-size: 0.7rem;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(139, 233, 253, 0.15);
}

.history-item.correct {
    border-color: rgba(80, 250, 123, 0.3);
    color: #50fa7b;
}

.history-item.wrong {
    border-color: rgba(255, 85, 85, 0.3);
    color: #ff5555;
    text-decoration: line-through;
}

/* Stats Summary - Hidden, using stats-row instead */
.stats-summary {
    display: none;
}

/* XP Container - Hidden, using xp-row instead */
.xp-container {
    display: none;
}

/* Stats Display - Cyberpunk Style */
.stats-row {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
    background: none !important;
    border: none !important;
    box-shadow: none !important;
}

.stat-box {
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(139, 233, 253, 0.25);
    border-radius: 8px;
    padding: 0.75rem 1.25rem;
    text-align: center;
    min-width: 85px;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.stat-box:hover {
    border-color: rgba(139, 233, 253, 0.6);
    box-shadow: 0 0 20px rgba(139, 233, 253, 0.3), inset 0 0 20px rgba(139, 233, 253, 0.05);
    transform: translateY(-2px);
}

.stat-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, #8be9fd, transparent);
    animation: scanline 2s ease-in-out infinite;
    pointer-events: none;
}

.stat-box::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(139, 233, 253, 0.1), transparent);
    animation: dataStream 3s ease-in-out infinite;
    pointer-events: none;
}

@keyframes scanline {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

@keyframes dataStream {
    0% { left: -100%; }
    50%, 100% { left: 100%; }
}

@keyframes glowPulse {
    0%, 100% { text-shadow: 0 0 5px currentColor; }
    50% { text-shadow: 0 0 20px currentColor, 0 0 30px currentColor; }
}

@keyframes borderGlow {
    0%, 100% { box-shadow: 0 0 5px rgba(139, 233, 253, 0.3); }
    50% { box-shadow: 0 0 15px rgba(139, 233, 253, 0.5), 0 0 30px rgba(139, 233, 253, 0.2); }
}

.stat-box.accent-green { border-color: rgba(80, 250, 123, 0.3); }
.stat-box.accent-green::before { background: linear-gradient(90deg, transparent, #50fa7b, transparent); }
.stat-box.accent-green:hover { border-color: rgba(80, 250, 123, 0.6); box-shadow: 0 0 20px rgba(80, 250, 123, 0.3); }

.stat-box.accent-cyan { border-color: rgba(139, 233, 253, 0.3); }
.stat-box.accent-cyan::before { background: linear-gradient(90deg, transparent, #8be9fd, transparent); }
.stat-box.accent-cyan:hover { border-color: rgba(139, 233, 253, 0.6); box-shadow: 0 0 20px rgba(139, 233, 253, 0.3); }

.stat-box.accent-orange { border-color: rgba(255, 184, 108, 0.3); }
.stat-box.accent-orange::before { background: linear-gradient(90deg, transparent, #ffb86c, transparent); }
.stat-box.accent-orange:hover { border-color: rgba(255, 184, 108, 0.6); box-shadow: 0 0 20px rgba(255, 184, 108, 0.3); }

.stat-label {
    font-size: 0.7rem;
    color: #6272a4;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.25rem;
}

.stat-value {
    font-size: 1.6rem;
    font-weight: bold;
    color: #8be9fd;
    font-family: 'JetBrains Mono', monospace;
    animation: glowPulse 3s ease-in-out infinite;
}

.stat-box.accent-green .stat-value { color: #50fa7b; }
.stat-box.accent-cyan .stat-value { color: #8be9fd; }
.stat-box.accent-orange .stat-value { color: #ffb86c; }

/* XP Bar */
.xp-display {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0;
    margin-bottom: 0.5rem;
}

.xp-rank {
    font-size: 0.85rem;
    color: #8be9fd;
    font-weight: bold;
    white-space: nowrap;
    animation: glowPulse 3s ease-in-out infinite;
}

.xp-bar-container {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.xp-bar {
    flex: 1;
    height: 8px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid rgba(139, 233, 253, 0.3);
}

.xp-fill {
    height: 100%;
    background: linear-gradient(90deg, #50fa7b, #8be9fd);
    border-radius: 4px;
    transition: width 0.5s ease;
    box-shadow: 0 0 10px rgba(139, 233, 253, 0.5);
    animation: xpGlow 2s ease-in-out infinite;
}

@keyframes xpGlow {
    0%, 100% { box-shadow: 0 0 5px rgba(139, 233, 253, 0.5); }
    50% { box-shadow: 0 0 15px rgba(139, 233, 253, 0.8), 0 0 25px rgba(80, 250, 123, 0.4); }
}

.xp-text {
    font-size: 0.7rem;
    color: #8be9fd;
    white-space: nowrap;
    font-family: 'JetBrains Mono', monospace;
}

/* New Achievement Popup */
.achievement-popup {
    position: fixed;
    top: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(-100px);
    background: rgba(20, 20, 30, 0.95);
    border: 2px solid #50fa7b;
    border-radius: 12px;
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    z-index: 300;
    opacity: 0;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 40px rgba(80, 250, 123, 0.4);
}

.achievement-popup.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.achievement-popup-icon {
    font-size: 2.5rem;
}

.achievement-popup-text h4 {
    color: #50fa7b;
    margin: 0 0 0.2rem 0;
    font-size: 0.8rem;
}

.achievement-popup-text p {
    color: #f8f8f2;
    margin: 0;
    font-size: 1rem;
    font-weight: bold;
}

/* Challenge Card */
.challenge-card {
    background: rgba(0, 0, 0, 0.45);
    border: 1px solid rgba(139, 233, 253, 0.18);
    border-radius: 10px;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    position: relative;
    overflow: hidden;
}

.challenge-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, #50fa7b, #8be9fd, #f1fa8c);
}

.challenge-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.4rem;
}

.challenge-title h2 {
    color: #8be9fd;
    font-size: 0.85rem;
    margin: 0;
}

.challenge-tag {
    background: rgba(139, 233, 253, 0.2);
    color: #8be9fd;
    padding: 0.1rem 0.4rem;
    border-radius: 3px;
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.challenge-description {
    color: #f8f8f2;
    margin-bottom: 0.4rem;
    line-height: 1.4;
    font-size: 0.8rem;
}

.challenge-hint {
    color: #6272a4;
    font-size: 0.7rem;
    margin-bottom: 0.5rem;
    padding: 0.3rem 0.5rem;
    background: rgba(98, 114, 164, 0.08);
    border-left: 2px solid #6272a4;
    border-radius: 0 3px 3px 0;
}

/* Terminal/File Display */
.file-display {
    background: #1a1a2e;
    border: 1px solid rgba(139, 233, 253, 0.12);
    border-radius: 6px;
    margin-bottom: 0.5rem;
    overflow: hidden;
}

.file-header {
    background: rgba(0, 0, 0, 0.35);
    padding: 0.25rem 0.6rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    border-bottom: 1px solid rgba(139, 233, 253, 0.08);
}

.file-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
}
.file-dot.red { background: #ff5555; }
.file-dot.yellow { background: #f1fa8c; }
.file-dot.green { background: #50fa7b; }

.file-name {
    color: #6272a4;
    font-size: 0.65rem;
    margin-left: 0.3rem;
}

.file-content {
    padding: 0.5rem 0.75rem;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    line-height: 1.4;
    max-height: 120px;
    overflow-y: auto;
}

.file-content .line {
    color: #f8f8f2;
    white-space: pre-wrap;
    word-break: break-all;
}

.file-content .line-number {
    color: #6272a4;
    user-select: none;
    margin-right: 0.6rem;
    min-width: 2ch;
    display: inline-block;
}

.file-content .highlight {
    background: rgba(80, 250, 123, 0.25);
    color: #50fa7b;
    padding: 0 2px;
    border-radius: 2px;
}

/* Input Area */
.grep-input-area {
    display: flex;
    gap: 0.25rem;
    margin-bottom: 0.5rem;
    position: relative;
    z-index: 10;
}

.grep-prompt {
    color: #50fa7b;
    font-family: 'JetBrains Mono', monospace;
    padding: 0.4rem 0.5rem;
    display: flex;
    align-items: center;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 4px 0 0 4px;
    border: 1px solid rgba(139, 233, 253, 0.2);
    border-right: none;
    font-size: 0.8rem;
}

.grep-input {
    flex: 1;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(139, 233, 253, 0.2);
    color: #f8f8f2;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    padding: 0.4rem 0.5rem;
    outline: none;
    transition: all 0.3s ease;
    position: relative;
    z-index: 10;
}

.grep-input:focus {
    border-color: rgba(139, 233, 253, 0.5);
    box-shadow: 0 0 10px rgba(139, 233, 253, 0.1);
}

.grep-submit {
    background: linear-gradient(135deg, #50fa7b, #8be9fd);
    border: none;
    color: #000;
    font-family: 'JetBrains Mono', monospace;
    font-weight: bold;
    padding: 0.4rem 0.75rem;
    border-radius: 0 4px 4px 0;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 0.75rem;
    position: relative;
    z-index: 10;
}

.grep-submit:hover {
    transform: scale(1.02);
    box-shadow: 0 0 15px rgba(80, 250, 123, 0.4);
}

/* Output Display */
.output-display {
    background: #0d0d1a;
    border: 1px solid rgba(139, 233, 253, 0.15);
    border-radius: 4px;
    padding: 0.4rem 0.5rem;
    min-height: 40px;
    max-height: 60px;
    overflow-y: auto;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
}

.output-display.success {
    border-color: rgba(80, 250, 123, 0.5);
    box-shadow: 0 0 20px rgba(80, 250, 123, 0.1);
}

.output-display.error {
    border-color: rgba(255, 85, 85, 0.5);
    box-shadow: 0 0 20px rgba(255, 85, 85, 0.1);
}

.output-line {
    color: #f8f8f2;
    line-height: 1.3;
}

.output-line.matched {
    color: #50fa7b;
}

.output-line.error-msg {
    color: #ff5555;
}

/* Feedback Messages */
.feedback {
    text-align: center;
    padding: 0.4rem 0.5rem;
    margin-top: 0.5rem;
    border-radius: 4px;
    font-size: 0.85rem;
    display: none;
}

.feedback.show {
    display: block;
    animation: feedbackPop 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.feedback.success {
    background: rgba(80, 250, 123, 0.15);
    border: 1px solid rgba(80, 250, 123, 0.3);
    color: #50fa7b;
}

.feedback.wrong {
    background: rgba(255, 85, 85, 0.15);
    border: 1px solid rgba(255, 85, 85, 0.3);
    color: #ff5555;
}

.feedback.hint-msg {
    background: rgba(255, 184, 108, 0.15);
    border: 1px solid rgba(255, 184, 108, 0.3);
    color: #ffb86c;
}

@keyframes feedbackPop {
    0% { transform: scale(0.8); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

/* Cheatsheet Panel */
.cheatsheet {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(139, 233, 253, 0.15);
    border-radius: 6px;
    padding: 0.5rem;
    margin-top: 0.5rem;
}

.cheatsheet-toggle {
    display: none;
}

.cheatsheet-toggle::after {
    content: '▼';
    font-size: 0.7rem;
    transition: transform 0.3s ease;
}

.cheatsheet.open .cheatsheet-toggle::after {
    transform: rotate(180deg);
}

.cheatsheet-content {
    display: block;
    padding-top: 0.3rem;
    border-top: none;
}

.cheatsheet.open .cheatsheet-content {
    display: block;
}

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

.cheatsheet-item {
    display: flex;
    gap: 0.3rem;
}

.cheatsheet-cmd {
    color: #50fa7b;
    font-family: 'JetBrains Mono', monospace;
    background: rgba(80, 250, 123, 0.1);
    padding: 0.1rem 0.3rem;
    border-radius: 3px;
    white-space: nowrap;
    font-size: 0.7rem;
}

.cheatsheet-desc {
    color: #6272a4;
    font-size: 0.7rem;
}

/* Celebration Animation */
.celebration {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 1000;
}

.confetti {
    position: absolute;
    width: 10px;
    height: 10px;
    animation: confettiFall 3s ease-out forwards;
}

@keyframes confettiFall {
    0% {
        transform: translateY(-100px) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotate(720deg);
        opacity: 0;
    }
}

/* Lesson Panel - Teaching before challenges */
.lesson-panel {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(189, 147, 249, 0.3);
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
    margin-bottom: 0.5rem;
    position: relative;
    overflow: hidden;
}

.lesson-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #8be9fd, #50fa7b, #f1fa8c);
}

.lesson-header {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    margin-bottom: 0.4rem;
}

.lesson-header h3 {
    color: #8be9fd;
    font-size: 0.85rem;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.lesson-tag {
    background: rgba(139, 233, 253, 0.2);
    color: #8be9fd;
    font-size: 0.65rem;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.lesson-content {
    color: #f8f8f2;
    font-size: 0.75rem;
    line-height: 1.5;
}

.lesson-content p {
    margin: 0 0 0.4rem 0;
}

.lesson-content p:last-child {
    margin-bottom: 0;
}

.syntax-box {
    background: #1a1a2e;
    border: 1px solid rgba(80, 250, 123, 0.2);
    border-radius: 4px;
    padding: 0.3rem 0.5rem;
    margin: 0.4rem 0;
    font-family: 'JetBrains Mono', monospace;
}

.syntax-box code {
    color: #50fa7b;
    font-size: 0.75rem;
}

.syntax-box .comment {
    color: #6272a4;
    font-size: 0.8rem;
    display: block;
    margin-top: 0.3rem;
}

.lesson-examples {
    margin-top: 0.75rem;
}

.lesson-examples h4 {
    color: #8be9fd;
    font-size: 0.8rem;
    margin: 0 0 0.5rem 0;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.example-item {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
    margin-bottom: 0.4rem;
    font-size: 0.85rem;
}

.example-cmd {
    color: #50fa7b;
    font-family: 'JetBrains Mono', monospace;
    background: rgba(80, 250, 123, 0.1);
    padding: 0.15rem 0.4rem;
    border-radius: 3px;
    flex-shrink: 0;
}

.example-desc {
    color: #aaa;
}

.lesson-tip {
    background: rgba(255, 184, 108, 0.1);
    border-left: 3px solid #ffb86c;
    padding: 0.5rem 0.75rem;
    margin-top: 0.75rem;
    border-radius: 0 6px 6px 0;
    font-size: 0.85rem;
    color: #ffb86c;
}

/* Two-Column Grid for Learn + Challenge */
.content-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.content-grid .lesson-panel {
    margin-bottom: 0;
}

.content-grid .challenge-card {
    margin-bottom: 0;
}

/* Level Complete Modal */
.level-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.level-modal.show {
    display: flex;
    animation: modalFadeIn 0.3s ease;
}

@keyframes modalFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.level-modal-content {
    background: rgba(13, 13, 26, 0.95);
    border: 1px solid rgba(139, 233, 253, 0.3);
    border-radius: 16px;
    padding: 2rem;
    text-align: center;
    max-width: 400px;
    animation: modalPop 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes modalPop {
    from { transform: scale(0.8); }
    to { transform: scale(1); }
}

.level-modal-content h2 {
    color: #50fa7b;
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
}

.level-modal-content p {
    color: #f8f8f2;
    margin-bottom: 1.5rem;
}

.level-modal-content .xp-gained {
    color: #8be9fd;
    font-size: 1.2rem;
    margin-bottom: 1rem;
}

.next-level-btn {
    background: linear-gradient(135deg, #8be9fd, #50fa7b);
    border: none;
    color: #000;
    font-family: 'JetBrains Mono', monospace;
    font-size: 1rem;
    padding: 0.75rem 2rem;
    border-radius: 8px;
    cursor: none !important;
    transition: all 0.3s ease;
}

.next-level-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 0 30px rgba(139, 233, 253, 0.4);
}

/* Stage Indicator */
.stat-box.stage-indicator {
    position: relative;
    background: linear-gradient(135deg, rgba(189, 147, 249, 0.15), rgba(139, 233, 253, 0.1));
    border: 1px solid rgba(189, 147, 249, 0.3);
}

.stat-box.stage-indicator .stat-multiplier {
    position: absolute;
    bottom: 2px;
    right: 4px;
    font-size: 0.5rem;
    color: #ffb86c;
    opacity: 0.9;
}

.stat-box.accent-purple {
    border-color: rgba(189, 147, 249, 0.3);
}

.stat-box.accent-purple .stat-value {
    color: #bd93f9;
}

/* Stage Complete Modal */
.stage-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1001;
    backdrop-filter: blur(10px);
}

.stage-modal.show {
    display: flex;
    animation: modalFadeIn 0.3s ease;
}

.stage-modal-content {
    background: linear-gradient(180deg, rgba(13, 13, 30, 0.98), rgba(20, 20, 40, 0.98));
    border: 2px solid rgba(189, 147, 249, 0.4);
    border-radius: 20px;
    padding: 2.5rem;
    text-align: center;
    max-width: 450px;
    width: 90%;
    animation: modalPop 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    box-shadow: 0 0 60px rgba(189, 147, 249, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.stage-modal-content h2 {
    color: #bd93f9;
    font-size: 2rem;
    margin-bottom: 0.5rem;
    text-shadow: 0 0 30px rgba(189, 147, 249, 0.5);
}

.stage-modal-content .stage-name {
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 1.5rem;
    text-transform: uppercase;
    letter-spacing: 0.2em;
}

.stage-stats {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 2rem;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
}

.stage-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stage-stat-label {
    font-size: 0.7rem;
    color: #6272a4;
    text-transform: uppercase;
    margin-bottom: 0.3rem;
}

.stage-stat-value {
    font-size: 1.4rem;
    font-weight: bold;
    color: #50fa7b;
}

.stage-stat-value.stage-xp {
    color: #8be9fd;
}

.next-stage-preview {
    background: rgba(139, 233, 253, 0.05);
    border: 1px solid rgba(139, 233, 253, 0.2);
    border-radius: 12px;
    padding: 1.2rem;
    margin-bottom: 1.5rem;
}

.next-stage-preview h3 {
    font-size: 0.8rem;
    color: #6272a4;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
}

.next-stage-preview .next-stage-name {
    font-size: 1.3rem;
    font-weight: bold;
    margin-bottom: 0.3rem;
}

.next-stage-preview .next-stage-desc {
    font-size: 0.75rem;
    color: #f8f8f2;
}

.next-stage-preview .next-stage-desc span {
    color: #ffb86c;
    font-weight: bold;
}

.stage-modal-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.stage-advance-btn {
    background: linear-gradient(135deg, #bd93f9, #ff79c6);
    border: none;
    color: #fff;
    font-family: 'JetBrains Mono', monospace;
    font-size: 1rem;
    font-weight: bold;
    padding: 1rem 2rem;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.stage-advance-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 0 40px rgba(189, 147, 249, 0.5);
}

.stage-end-btn {
    background: transparent;
    border: 1px solid rgba(98, 114, 164, 0.5);
    color: #6272a4;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    padding: 0.6rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.stage-end-btn:hover {
    border-color: rgba(255, 85, 85, 0.5);
    color: #ff5555;
}

/* Mobile Responsiveness */
@media (max-width: 600px) {
    .grep-header h1 {
        font-size: 1.2rem;
    }

    .stats-row {
        gap: 0.4rem;
    }

    .stat-box {
        padding: 0.4rem 0.6rem;
        min-width: 55px;
    }

    .stat-label {
        font-size: 0.5rem;
    }

    .stat-value {
        font-size: 1rem;
    }

    .xp-display {
        padding: 0.3rem 0.5rem;
        flex-wrap: wrap;
        justify-content: center;
    }

    .grep-input-area {
        flex-direction: column;
    }

    .grep-prompt {
        border-radius: 4px;
        border-right: 1px solid rgba(139, 233, 253, 0.2);
    }

    .grep-input {
        border-radius: 4px;
    }

    .grep-submit {
        border-radius: 4px;
    }

    .home-link {
        top: 0.5rem;
        right: 0.5rem;
        font-size: 0.6rem;
        padding: 0.3rem 0.5rem;
    }

    .hologram-container,
    .hologram-image {
        max-width: 120px;
    }

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

    .lesson-panel {
        padding: 0.4rem 0.5rem;
    }

    .lesson-header {
        flex-wrap: wrap;
        gap: 0.3rem;
    }

    .lesson-header h3 {
        font-size: 0.75rem;
    }

    .syntax-box {
        padding: 0.25rem 0.5rem;
        font-size: 0.7rem;
    }

    .example-item {
        flex-direction: column;
        gap: 0.2rem;
    }

    .level-node {
        width: 18px;
        height: 18px;
        font-size: 0.55rem;
    }

    .challenge-card {
        padding: 0.5rem;
    }

    .file-content {
        max-height: 80px;
        font-size: 0.65rem;
    }

    .output-display {
        max-height: 50px;
    }
}

/* Scrollbar styling */
.file-content::-webkit-scrollbar {
    width: 6px;
}

.file-content::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
}

.file-content::-webkit-scrollbar-thumb {
    background: rgba(139, 233, 253, 0.3);
    border-radius: 3px;
}

.file-content::-webkit-scrollbar-thumb:hover {
    background: rgba(139, 233, 253, 0.5);
}
